How to pause the game until next click & Find Vector3 position in List :/ ?
Hallo Community :)
I got a Problem. I'm trying to code a Ludo game. So i got a dice and a dice roller function and they work well. This is how the code looks --> this is the Dice rollerScript (by clicking on the UI.button)
public void OnClick()
{
GetComponent<Rigidbody>().AddForce(Random.onUnitSphere * forceAmaount, forceMode);
GetComponent<Rigidbody>().AddForce(Random.onUnitSphere * torqueAmount, forceMode);
}
the other Code is in a seperate script, called currentDicevalue:
public LayerMask würfelWertColliderLayer = -1;
public int anzahlVersuche = 0;
public int aktuellerWert;
// Update is called once per frame
void Update ()
{
RaycastHit hit;
if(Physics.Raycast(transform.position, Vector3.up,out hit, Mathf.Infinity, würfelWertColliderLayer))
{
if (GetComponent<Rigidbody>().IsSleeping())
{
aktuellerWert = hit.collider.GetComponent<WürfelWert>().wert;
//Debug.Log(aktuellerWert);
anzahlVersuche++;
}
//Debug.Log(aktuellerWert);
}
In my Script called gameController is a while loop "while(playerRed)" do something... (now i only one player)
How to pause my Loop until the next click is done ? (and a new dice number show up)?
I tried it with bools, with increments a int.. but it don' works
Your answer
Follow this Question
Related Questions
Is UI affected by time scale ? 1 Answer
How o know what is the GameObjectName of a button? 0 Answers
Pausing a game 2 Answers
How to change a variable used in a loop for the outside ? 1 Answer
Looped Animation 0 Answers