- Home /
Moving multiple objects at same speed
Hi Im making a little animation at the end of my level where a black hole appears at the center of the screen and all the planets in the scene move towards it at the same speed simultaneously. Because the planets are all different distances away from the black hole they should reach the black hole at different times. My question is how do you move multiple objects at the same speed towards a specific point? Thanks!
Answer by ozturkcompany · Apr 04, 2015 at 08:25 PM
It is pretty straightforward. For instance;
var Earth : GameObject;
private var Speed : float = 5;
function Update()
{
Earth.transform.position = Vector3.MoveTowards(Earth.transform.position, Vector3(bla, bla, bla), Speed * Time.deltaTime);
}
Your answer
Follow this Question
Related Questions
How can I implement a SimpleMove max speed? 1 Answer
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Setting Scroll View Width GUILayout 1 Answer
error with maxbackwardsSpeed 1 Answer
How to set speed limit of car? 3 Answers