I want a script that some ball going up the screen randomly and we can click on it to have some point ... I don't know how to do this script.
Thanks for your help
I want a script that some ball going up the screen randomly and we can click on it to have some point ... I don't know how to do this script.
Thanks for your help
Your question wasn't quite clear, but I think that you want a ball to move up the screen but start at a random point on an axis?.
If so, then try this script:
var fireRate : float;
var ball prefab : GameObject;
private var lastShot : float = 0;
function Update()
{
if(Time.time > lastShot) {
var go : GameObject = Instantiate(ballPrefab, transform.position, transform.rotation);
lastShot = Time.time + fireRate;
}
}
Then just add a constant force to the ball, and a simple ping pong movement(via animation) to the empty game object the above script is attached to.