- Home /
Collision with moving door
Hello community,
I have a problem with an animated door. When the door is standing still, I collide with it. When the door is moving, the door ignores the collision and I can walk trough the door. But this problem only exists when the door is moving in my direction, when I collide with the door from the backside, the collision is working.
I tried different colliders, as well as rigidbodys (Animate physics is checked and collision detection is continous dynamic). No of them are working. Would be great if you can give me some ideas.
Thanks!
I'm not sure if there should be a difference between colliding with the front and back of a collider. Any chance that the center of the object is off? It would also be great if you could share the code that rotates the door.
$$anonymous$$ake sure the collider and door are thick enough. Also, moving with transform functions will cause collider teleportation. Consider using AddForce or AddTorque and constrain axes ins$$anonymous$$d. You can change the pivot point but I haven't looked in to that. Or you can use hinges.
There is no code to share. Its just an animation (exported from Cinema 4D) that rotates a door. And for the character Iam using the default FPS character Controller.
I think the difference colliding from the back is, that the character is moving against the door, while colliding from the front, the door is the moving part.
Cause in Cinema4D I have complex animation systems and dont need to fight with some scripts