I need help plss

I need help with this mistake please…
is part of an ammo system, unload.
error occurs while trying to empty the gun

My Script…

Show the code using the line numbers in the error text, specifically the code at Assets/Ultimate Survival/Scripts/ItemUnload.cs:98 (line 98)

1 Like

Null reference exception means you are using a variable that doesn’t have a value.

Please post code using code tags, not as a quote. If your error message references a specific line of code, always make it clear which line that is in the code that you post.

2 Likes

Edited

You’ll want to ensure that itemInspector isn’t null on line 23, Debug.Log it! Tips for new Unity users

1 Like

Either itemInspector is null, OR itemInspector.InspectedSlot is null.

1 Like

hi guys I got the mistake, it was just my carelessness … thank you very much <3