- Home /
CharacterController can jump through moving objects
I have a character that is using unity's character controller and character motor. There is a section in the level where the character has to jump across platforms and avoid objects moving towards him but when these objects hit him he just passes right through.
These moving objects do have box colliders on the them.
Thank you for your time.
EDIT: Also when jumping the character cannot pass through the objects if they are colliding with the top or bottom of him i.e. he is jumping up into a moving object he does not pass through at all.
After more debugging it seems the problems is that the objects that the character passes through are rotating into him and that causes him to pass through them.
Picture a spinning cube (horizontally spinning) with walls coming out of it's sides. When the player walks into one of the walls he can jump through it.
Have you set the Rigidbody Collision Detection to Continuous Dynamic for the objects so that it is tracking two moving dynamic objects for constant collision? I think it is more overhead but suits what you are looking for.
I set the collision detection to Continuous Dynamic but got the same results.
Answer by DaveA · Jul 25, 2013 at 06:17 PM
Try putting RigidBodies on those moving objects
I put ridgid bodies on them and it provides more resistance but the character still goes through. Could it be that it's not a problem with collision but with the character forcing his way through?
Rigid bodies only add physics to the objects, you must add a collider component
Any luck with this? I've go the same thing going on.
I have a rotating wall. If the character pushes against the side that's rotating away from the character, collisions stop the character.
However, if the character runs into the side that is rotating into the character, the character runs right through that side of the wall.
All combinations of physics object, collider, rigidbody.move(), etc don't work. :(
I ended up writing my own character motor and added a rigidbody and colliders to the player object.