- Home /
When does a pos of a gameObject change from its velocity?
I have a situation in which a certain gameObject has a certain velocity. One frame I decide to change the ongoing velocity, for example if it has been -5(the axis doesn't matter) I make it 5. My question is, when is the position of the gameObject going to change according to its new velocity? The very frame I change the velocity or the next frame? Please, don't answer if you're not sure whether your answer is correct or not because the project is on the edge of falling apart if a few new bugs appear in the near future.
Answer by tanoshimi · Jan 18, 2015 at 04:33 PM
Neither - it'll be the next time FixedUpdate is called (by default, 50 times per second).
From your answer I get to understand that no matter where I change the physics logic of any gameObject i.e. in the update or late update or in a coroutine or wherever I can think of, the changes are going to apply to the gameObject in the FixedUpdate?
Well, the movement really happens in the physics step, which happens right after the FixedUpdate. It's the grey box labelled "Internal physics update" in that link. But everyone calls it a physics step.
It's a very nice, helpful picture.
Your answer
Follow this Question
Related Questions
[C#] Accelerate then decelerate to its wanted position 1 Answer
Accurate and timely velocity-based movement 0 Answers
how to stop the camera to follow the player on his jump movement ? 2 Answers
Smooth Camera/Object Movement 1 Answer
Movement using rigidbody.velocity to apply a constant force until stop 1 Answer