- Home /
Question by
DocteurCox · May 30, 2012 at 02:05 PM ·
charactercontrollercollisions
The proper way to use CollisionsFlags ?
Hey there !
I've recently been doing some experiment with Unity's built-in CharacterController. I've got somethings that works relatively well. However, I'm having some troubles with CollisionFlags.
I'm trying to create a "one-way platform" system with that component. For that purpose, I've made several functions that basically detects if my controller is touching the ceiling, the ground and so on.
private bool TouchingGround()
{
return (m_controller.collisionFlags & CollisionFlags.Below) != 0;
}
This should be working, but the result of that function is pretty random. Sometimes it returns true while I'm jumping, and it returns false when I'm grounded. The same is true for member variable isGrounded the result of which is pretty much the same as my method's.
Did I do something wrong ?
Thanks in advance for your advices ;)
Comment
Your answer