so im having a problem this appears when ever a grenade exploads in my game the effect just keeps going up when it happens how can i fix this
Hey, first of all: You should always give more information about your problem / game so people can figure out what’s going on. Try to share some of the code your working on.
At first sight, the Null reference error has nothing to do with movement. This error appears when your code is not exact enough and unity can’t find what you want to reference.
BUT: When a null reference occurs the code after it is not executed. This can lead to additional malfunctions and seemingly different problems. If the null reference error is okay and will be set later on you can set a condition like this:
if(!“your missing reference”) {
// code here executes even when there is no reference found
}
If the null reference error is not intentional: Make sure it’s referenced by publicly set it in the inspector or just track it down where it’s missing a set it up private:
“youre missing reference” = “reference”
Null Reference Errors are a problem every beginner runs into but it’s 100% always some small mistake maybe even a typo which leads to it.