Basically the character is “hanging” after you jump and he hits his head on a platform only while move left or right. If you are standing still he hits his head and returns normally to the ground (mario style). If you are moving to the left or right he will float for a short while until gravity picks him back up again. If you leave from under the platform you hit he falls normally right away.
It’s a problem that I’ve had since the beginning and I’ll spend a few hours trying to fix it, leave defeated only to come back and spend a few more hours on it another day. The cycle repeats. Any help would be immensely appreciated!
Cheers
// Move the controller, and set collidedDown true or false depending on whether we're standing on something
flags=controller.Move(moveDirection*Time.deltaTime);
//Detect character controller collision
collidedDown=(flags & CollisionFlags.CollidedBelow)!=0;
collidedUp=(flags & CollisionFlags.CollidedAbove)!=0;
collidedSides=(flags & CollisionFlags.CollidedSides)!=0;
if(collidedUp){
moveDirection.y=0;
}
// Apply gravity
moveDirection.y -= gravity * Time.deltaTime;