- Home /
i get more clicks than the clicks really happens
i have this code void Update () { if(Input.GetMouseButton(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit rayCastHit; if(Physics.Raycast(ray.origin, ray.direction, out rayCastHit, Mathf.Infinity)) { clicks+=1; Debug.Log(clicks); if (clicks%2!=0) { Time.timeScale = 0; BirdMovement.Instance.isPaused = true; } if (clicks%2!=1){ Time.timeScale = 1; BirdMovement.Instance.isPaused = false; } } } }
when i make one click on the gameobject , the log shows more clicks ( 4-6 more clicks ) .
i use this c# script to pause and resume the game , but i can't do that successfully if the clicks are more than the real ones .
any suggestion ?
Answer by TakisBeskos · Mar 08, 2014 at 11:20 PM
i've found it .
i just used Input.GetMouseButtonUp :P
sorry if that was foolish , it's the first time i am trying to make a game
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
counting of two different objects 0 Answers
Flip over an object (smooth transition) 3 Answers
Pause Menu Text Not Rendering 0 Answers