Hello everyone! I can’t seem to find what the cause of the issue is even though I’ve fixed plenty of the same errors before. I’m getting a “NullReferenceException: object reference not set to an instance of an object” only when I try to call on my MoveCharacter function from a OnMouseUp function. Here is the code. Error is at line 45 of TileClickable.
I don’t understand why it is only happening when I call the function from the OnMouseUp. Thank you in advanced and sorry if the code is a little messy, I’m just trying to get a really rough prototype done. Besides, there’s not much code anyways :p.
EDIT: I also have the object I want moved set as selectedUnit already. ![]()