- Home /
How do you avoid collisions when teleporting CharacterControllers?
In my game I need to teleport game objects (colliders and triggers) in close proximity to each other without them colliding. In some cases, after a collider and a trigger are already touching, I need to move them both without OnTriggerExit or OnTriggerEnter being called again
This works for Rigidbodies and triggers but not for CharacterControllers and triggers. I believe CharacterController collision is handled differently than Rigidbody (even when Rigidbody is set to dynamic).
These are the two behaviours I need to support.
If a character controller is inside of a trigger, I can move both the controller and the trigger (together so they remain connected) and no new OnTriggerExit or OnTriggerEnter will be called.
If a character controller and a trigger (not touching) switch places, no OnTriggerEnter and OnTriggerExit will be called at all. ie. no collision is detected because they never actually collide.
Like I said, the above works fine with Rigidbodies but not with CharacterControllers. If I attempt either of the above, there is a call to exit and a call to enter for #1 and a call to enter and to exit for #2.
Behaviour #2 can be met for CharacterControllers if it is set to inactive before moving and then reactivated after moving. However, this breaks behaviour #1.
Thanks for your help.
You should rewrite your question because I can't decipher what you're trying to ask.
Thanks, I'll try to rewrite it to be more clear.
Your answer
Follow this Question
Related Questions
Did triggers inside loaded gameobjects break in a recent update? 0 Answers
OnCollisionEnter not working with CharacterController 1 Answer
Problem with TriggerEnter/Exit Execution Order 0 Answers
Object Leaves Parent's Trigger During Parent Movement 2 Answers
Fastest way to check for bounding box partially or fully inside another bounding box? 1 Answer