- Home /
IsGrounded Script Not Working
My IsGrounded Script Is Not Working And I Cant Figure Out Why.
public void UpdateStats()
{
if (IsGrounded == true)
{
HitDistance = 0.35f;
}
if (Physics.Raycast(transform.position - new Vector3(0, 0.85f, 0), -transform.up, HitDistance, IsGround))
{
IsGrounded = true;
}
else
{
IsGrounded = false;
}
}
void Update()
{
UpdateStats();
}
Comment
Your answer
Follow this Question
Related Questions
Change the direction of ScreenPointToRay() Ray 1 Answer
detection raycast too late 2 Answers
RayCast Nearest Character 0 Answers
Raycast doesn't work properly? 0 Answers