I keep getting 999+ of the error “NullReferebceException: Object reference not set to an instance of an object” The line of code:
var rb = object.GetComponent(Rigidbody);
In the script I have it where if you click it instantiates a prefab there, and attached to the prefab are some scripts, colliders, and rigidbodies. After getting its Rigidbody I apply force to it. My script works just as I wanted it to. How can I fix this error, or is there anyway I can just ignore it? I would just disable error popups in the console but I still need to check for other errors. Thanks in advance.