|
I am using following code to throw the ball. When the player clicks on "Hit" button the screen also moves to the left side. I need solutions for two different situations if any can help:
Regards, Zia Khatri function OnGUI() { if(GUI.Button(Rect(125, Screen.height-125 , 250, 125), "Hit") ) { if(actionStatus == false){ if(slabstatus1.Balls_count<3){ var ball: GameObject = Instantiate(ballPrefab, transform.position, Quaternion.identity) as GameObject; ball.rigidbody.AddForce(transform.forward * 900); } actionStatus = true; } } }
(comments are locked)
|

by the Screen "Moving", do you mean the camera in the scene?
unless the camera is inside a moving object, I do not see how this script is affecting the camera's transform...