- Home /
isGrounded not always true every frame?
The Code:
bool IsGrounded () { return (collisionFlags & CollisionFlags.CollidedBelow) != 0; }
if(IsGrounded ())
{
v3_MoveDirectionVector = new Vector3(0f, 0,Input.GetAxisRaw("Vertical")); v3_MoveDirectionVector = transform.TransformDirection(v3_MoveDirectionVector); v3_MoveDirectionVector = f_Speed ; } cc_CharacterControllerOfPlayer.Move(v3_MoveDirectionVector Time.deltaTime); print(IsGrounded ());
In most time,this code works fine,but in some frames,it prints "false" when I move player on the ground.Even while in the air,it print"true"! Is it a defect of Unity3d?
Heyiwouldanswerthisgladlybuticantevenreadthismess.
Please please please FOR$$anonymous$$AT THE COD$$anonymous$$
Your answer
Follow this Question
Related Questions
Keeping speed while crouching in midair and remove clipping while returning to standing 2 Answers
Can Someone Help me with my Onclick Jump Button to only fire only if Grounded 1 Answer
Ground Detection 2 Answers
Unity 2D Platformer: How to properly implement this ground check? 1 Answer
isGrounded too sensitive? 0 Answers