Quantcast
Channel: Answers by "iggy"
Viewing all articles
Browse latest Browse all 47

Answer by iggy

$
0
0
getting that random number is like this: x=Random.Range(-4, 4); http://unity3d.com/support/documentation/ScriptReference/Random.Range.html but if you want sphere to move from 4 to -4 in ping pong motion use this: transform.position = Vector3(Mathf.PingPong(Time.time, 8)-4, transform.position.y, transform.position.z);

Viewing all articles
Browse latest Browse all 47

Latest Images

Trending Articles





Latest Images