Closed SpicyFlanx closed 9 months ago
This is actually a great idea and should be relatively easy to add. I'll put it on the list.
Just to make sure we get a nice usable API: This is what I currently have in mind:
# on transition.gd
## Fired when this transition is taken. For delayed transitions, this signal
## will be fired when the transition is actually executed (e.g. when its delay
## has elapsed and the transition has not been arborted before). The signal will
## always be fired before the state is exited.
signal taken()
Will this be sufficient for your needs @Svaught598 , @SpicyFlanx ?
@derkork It's working great, thanks!
The State Charts (format?) provides for actions being placed on transitions, and I think this might be a useful addition to the addon. For example, I'm working on a project with walljumping, which has different behavior from a regular jump. To model this, I've added additional "jump" states with associated entry actions so their execution can be handled by the state chart- but these states serve no other purpose, don't fit with my chart's conventions, and they aren't really states so much as actions that should happen alongside a transition.
Perhaps transitions should provide signals that emit when the transition occurs?