- Home /
Confusion in deciding the units for game objects
Hi, I am new in unity and i have a confusion. May be it will be a silly question but i am confused about this. My question is why we multiply a vector with any parameter if we want to move a game object. Suppose i have a game object and i want to move it in direction of z axis. i will use these different codes
transform.Translate(Vector3.forward * Time.deltaTime);
transform.Translate(Vector3.forward *100);
transform.Translate(new Vector3(0,0,100));
similarly when we add force to rigid bodies we use these codes
rigidbody2D.AddForce(Vector2.up*300.0f);
this.rigidbody2D.AddForce(Vector2.up*Time.deltaTime);
rigidbody2D.AddForce(new Vector2(0,300));
There are many more scenarios where we multiply with a parameter.
why there is many different ways to do this task.. And most importantly why we always not multiply a vector with Time.deltaTime.
Simply i want to say how can i decide that i should multiply vector with any value or Time.deltaTime.
Answer by getyour411 · Aug 04, 2015 at 09:36 PM
Time.deltaTime is pretty well documented
http://docs.unity3d.com/ScriptReference/Time-deltaTime.html
and honestly, the others are too (transform.Translate, AddForce, etc).