All Questions

Community

R
Xavier Restituyo

Attempted this one too Counter correctly updates label and toggles fsm.is_active

You have a discord I can shoot my compressed project folders to? I'm sure I followed this one correctly and my label in my test scene updates according to delta debugged in console to print out state machine is_active bool

func _input(event: InputEvent) -> void: if event.is_action_pressed("ui_cancel"): fsm.is_active = not fsm.is_active #toggles okay not deactivating counter? 
print(str(fsm.is_active)) 

Correctly toggles bool in console, but doesn't stop Counter State from running

func _process(delta)-> void: time_elapsed += delta label.text = "Counter: " + str(round(time_elapsed)) 

Although State and StateMachine declare to set _process to is_active their not values with the setget set_is_active

  • Nathan Lovato replied

    Your state's method name is incorrect, you're using _process, with a leading underscore, instead of the process callback the state machine will call. So your State's _process function is being called directly by Godot, and not by the state machine.

  • Nathan Lovato replied

    And yes, here's our discord: https://discord.gg/CHYVgar

    Mannequiny being a bit big, I'm not sure you'll be able to upload this project there. If that's the case you can use a cloud or upload service of your choice instead.