#My enemies stopped working

8 messages · Page 1 of 1 (latest)

rocky nacelle
#

Hey, i'm making a top-down shooter. The enemies worked well before but now i just get a crash when they are in the game.
I made the player a unique name and reference it as '@onready'. This worked before! I changed something in the Player script but I don't know what could have caused this. Somehow the enemy now does't find the player which it uses to find its direction towards him.

floral fiber
#

The symbol at player in the variable deceleration should be a "$" symbol

livid ravine
#

Try setting player using an @export + selecting player in the editor instead of an @onready. Based on your error that should fix your issue

rocky nacelle
#

I have both in an own scene. I also figured out that a new codeblock crashes it but I currently don't understand why

rocky nacelle
#

Thank you! this works, now back onto damage functions 🙂

livid ravine
#

np! In the future, when the error message mentions Attempt to.... in base 'Null instance/Nil' it usually is your variable not being set correctly. In this case it was player