- Home /
Rigidbody.velocity and Time.deltaTime
Hello, I have a question about the movement of a rigidbody. I am modifying the velocity of the rigidbody directly to move it. When I multiply the vector with a speed variable, do I need to multiply it with Time.deltaTime, too? I am asking this, because when I do, I need to have very large numbers for the speed variable, which seems not right to me (I already adjusted the scale of my objects, because I was working with a CharacterController before changing it to a Rigidbody).
Answer by aldonaletto · Jul 10, 2012 at 04:12 AM
No, you just assign the velocity vector to rigidbody.velocity. When you multiply a velocity by Time.deltaTime, you actually get the displacement since last frame (that's what CharacterController.Move requires; for SimpleMove, you just pass the velocity)
Answer by amin-khan · Jan 17, 2017 at 11:57 AM
then without multiplying time.deltatime can not give the actual output on building this for andriod mobile phones ... any idea ??
Answer by josephthomaa · Jan 17, 2017 at 12:30 PM
If you add or subtract to a value every frame chances are you should multiply with Time.deltaTime. When you multiply with Time.deltaTime you essentially express: I want to move this object 10 meters per second instead of 10 meters per frame.
Read this document>https://docs.unity3d.com/ScriptReference/Time-deltaTime.html