Field jump.rb is never assigned to, and will all ways have its defualt value null

I don’t know what im doing wrong and aparently you get this error when you don’t use the variable but im using it multiple times in my script.

using UnityEngine;
using System.Collections;

public class Jump : MonoBehaviour
{

private bool OnGround;
private Rigidbody rb; 

void Start()
{
    OnGround = true;
    rb = GetComponent<Rigidbody>();
}

void Update()
{
    if(OnGround)
    {
        if (Input.GetButton("Jump"))
        {
            rb.velocity = new Vector3(0.0f, 10f, 0.0f);
            
        }
        else
        {
            rb.velocity = new Vector3(0.0f, 0f, 0.0f);
            OnGround = false;
        }
        

   
}

}

void OnCollisonEnter(Collision other)
{
if (other.gameObject.CompareTag(“ground”))
{
OnGround = true;
}
}
}

If you clear the console does the message come back? Maybe it was still there from an earlier version of the script. Your script looks fine, and, like you say, rb is definitely being used.

are you joking me?:smiley: On EXIT not ENTER OnCollisionExit