I might do a tutorial like this after this current competition ends on the 11th, until then I'm pretty swamped.
Without getting too far into the nitty gritty, I use States / a State Machine in combination with an update loop for this.
The StateMachine is just a plain ole class (not a Component) that calls functions on State classes, which encapsulate specific behaviors (like Idle, Attack, Death, whatever). This keeps your behaviors separate and neatly organized.
You can create a basic update loop within a Component by connecting to the hz.World.onUpdate local broadcast event. My implementation usually looks like this:
this.connectLocalBroadcastEvent(hz.World.onUpdate, (update: { deltaTime: number }) => { this.stateMachine.update(deltaTime) });
---
I used this setup to create the behaviors seen here.
https://www.youtube.com/watch?v=ZnY26YfpL20
If you want to know more let me know, I'm happy to share some typescript files for a basic state machine setup.