UnassignedReferenceException - But it is assigned

Hello everyone,

I have a very strange problem. One of my scripts spams error messages in the console and is telling me, that the sprite renderer hasn’t been assigned. But the sprite renderer is assigned and everything works correctly… animations get played… the script flips the sprite when it should do it… but still I get those annoying error messages. Has anyone an idea where the problem could be?

My best guess is you have another object in your scene with the EnemieController.cs script attached that does not have sRenderer assigned.

1 Like

Thank you for your answer, but sadly that is not the case. there is only one game object in my scene with the EnemieController Script

EDIT: I just found it and you were right, I attached a wrong script to a child game object of my enemy game object :face_with_spiral_eyes:. Thank you!