Closed mrjshzk closed 4 months ago
The state classes are not designed or tested for being subclassed by user code, so you will need to be extra careful when working this way to not accidentally break functionality in the base classes.
Your particular problem seems to be caused by overriding _ready
. The base State
class also has a _ready
implementation and if you override this it will not be called. This in turn skips some necessary initialization which leads to the error you are seeing. You should be able to fix this problem by calling super
in your _ready
function:
func _ready():
super() # call the base implementation to make sure everything is initialized
state_entered.connect(state_started)
state_physics_processing.connect(physics_processing)
nav_agent.navigation_finished.connect(finished_wander)
that was it :) thank you so much! and what a dumb little mistake :p
Hello! Sorry to bother you. I'm trying to make my enemy's AI using this plugin. Instead of having a big script in the root node or the character node, I am extending from the AtomicStates to manage my behaviours.
This is currently my wander code:
This send event is crashing, could you help me out if I'm doing anything incorrectly? Thanks.