Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compound state with an initial state and an automatic transition to another child state will activate both states #100

Closed
HymnStudio opened this issue Mar 28, 2024 · 2 comments

Comments

@HymnStudio
Copy link

Here I use the example scene in performance_test, add a transition node to Root compound state, which is an automatic transition to StateB with no delay time and guard.
image

By doing so, a compound state can have its two child both active at the same time:
image

I am not sure if it is intended, but here is my understanding: when entering compound state,1. it first calls the base state _state_enter() method, triggering the automatic transiton to active StateB,2. then it calls its _state_enter() method, activating StateA according to its initial state setting:
image

@derkork
Copy link
Owner

derkork commented Mar 28, 2024

Thanks a lot for reporting this! This definitely looks wrong. A compound state should under no circumstances have more than one child state active at any given time. So i think the correct flow should be

  • Enter Root
  • Transition fires
  • Enter B

So an immediate transition will supersede any initial state (which is the idea behind this expect_transition flag, but it obviously is not properly set here). I will do a bit of investigation as such setups may lead to very interesting edge cases and I'll probably also need to update the manual to describe the behaviour that can be expected.

@derkork
Copy link
Owner

derkork commented Apr 2, 2024

I found another edge case if the transition leaves for a totally different state. Then the initial state is entered but never exited. Fixed this as well.

@derkork derkork closed this as completed in 7709859 Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants