- Home /
How do you force update a collider position?
I am running a simulation in my networked game which looks back at previous character states and will raycast where old shots originated and where characters were at the time of that shot. Updating the positions of the characters temporarily works fine by simply setting the transform.position to the position the character should be at, at a given time in the past. However, while the position of the transform is correct, the position of the collider attached to that gameobject does not update its position as I move the transform temporarily. (Remember I am moving the position of the object, doing a raycast , then repositioning the same object back to the place it was before running the temporary simulation.)
I can surmise from my testing that colliders positions are updated each FixedUpdate to be relative to the gameobject its added to, but for my needs I absolutely need the collider to be in the temporary position that I have set for it, then have it set back to what is was before I ran the simulation.
Is there a way to force a collider to update its position at a specific instant, and not wait for a fixed update to run?
Your answer
Follow this Question
Related Questions
Using cylinder colliders as wheels. 1 Answer
Make sphere collider the center of gameobjects/Sum of vectors 3 Answers
Physics artifacts on terrain seams 0 Answers
More realistic physics? 0 Answers