My check if is grounded is not working. All the tags are right. Here is my code:
public Rigidbody rb;
public bool isGrounded;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void FixedUpdate()
{
if(isGrounded)
{
if(Input.GetKey("space"))
{
rb.velocity = new Vector3(0, 10, 0);
}
}
}
void OnCollisionEnter (Collision collisionInfo)
{
if(collisionInfo.collider.tag == "Ground")
{
isGrounded = true;
}
else
{
isGrounded = false;
}
}