- Home /
Question by
Dupcjusz1 · Aug 01, 2021 at 10:34 AM ·
scripting problemground
Ground check not working
I'm a beginner and I doing simple 2D game. I made a script according to a Youtube tutorial, but ground check doesn't work.
public class Player : MonoBehaviour
{
public float moveSpeed;
public float jumpHeight;
public Transform groundCheck;
public float groundCheckRadius;
public LayerMask WhatIsGround;
private bool grouned;
// Start is called before the first frame update
void Start()
{
}
void FixedUptade()
{
grouned = Physics2D.OverlapCircle (groundCheck.position, groundCheckRadius, WhatIsGround);
}
Comment
I mean, how do you know it's not working? Try putting a Debug.Log()...like this
Debug.Log(grouned);
In the fixed update...and check what it returns in the editor
Best Answer
Answer by rage_co · Aug 01, 2021 at 10:50 AM
You have misspelled FixedUpdate()....due to that the code won't run so