translate forward and Time.deltaTime
I want my code to move the object forward with given distance. The speed is 10, and the distance is given by user. After running the code, my object is not moving smoothly. Can someone tell me what is happen? Thanks a lot. player.transform.Translate (transform.forward * n * Time.deltaTime);
the code is correct when ran in Update or LateUpdate. But if you're incorporating collision that's probably the cause of the stutter. in that case just set the rigidbody velocity to transform.forward * n in FixedUpdate.
Your answer
Follow this Question
Related Questions
Move player distance forward over time. 0 Answers
Changing the direction of what is considered "forward" 0 Answers
Move object towards a moving point C# 1 Answer
Using Time.deltaTime as a Timer 0 Answers
How to slow down my timer script? 0 Answers