- Home /
How to let the vectory turn a direction?
Hello everyone. Now I throw out a sphere to a cube and I hope the sphere can turn and move to the cube's direction. Like this image:
and like the bucket in "Donkey Kong Country Returns"(1:13~1:19) http://www.youtube.com/watch?v=yVq7XNV7K0w&feature=mfu_in_order&list=UL
Have any way can make this? think you.
Comment
Best Answer
Answer by Joshua · Apr 25, 2011 at 04:37 AM
Use
- OnCollisionEnter
check if the hit object is the cube you mentioned, using it's tag or name.
transform the direction of the sphere to the cube's transform.forward (if in the picture the forward is the direction of the second arrow. Else change your cube for that to be true).