-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Allow Transition nodes to be triggered via signals or code #152
Comments
Could you give some more insights on what you need this solution for? E.g. what is the underlying problem you're trying to solve with this? Couldn't your component just send an event to the state chart to trigger this transition? |
There is no problem really. This is just for convenience. Example: one of my node/code exposes a signal, and when that signal is emitted, I want to trigger a transition. Having a function in |
I think I understand this better now, thank you for explaining it to me! One thing I'm not quite sure about is how this would work with delayed transitions. Right now once a transition, which has a delay, is run, the transition will be enqueued. It can be replaced later by another transition while it is pending. I imagine this can be confusing behaviour if one calls ## transition.gd
func take(immediately:bool = true):
.. This would give the caller the flexibility to decide what happens, while at the same time doing the thing that most people would expect (I hope 😉). So calling it with |
That is so true, it might be confusing if the transition enqueued and executed later. I like your solution :). I will work on it and have a PR for you this week. |
Released with 0.18.0. Thanks for submitting the PR! I have added C# integration, docs and a few automated tests and seems to be working nicely. |
@derkork Thank you for taking time to review my PR. Going to start using the new release! |
I am currently working on a game using your framework and I would like to request a feature that allows Transition nodes to be called from code or triggered by signals to start a transition.
In my project, I need to allow a signal from a component to trigger a transition, and I want to be able to initiate the transition from within the editor using my custom signals rather than solely relying on the state machine's built-in functionality.
I have implemented the following solution in the
transition.gd
script. This method allows signals to be connected to a transition. When the signal is emitted, it calls the parent node (which in turn calls the state chart to start the transition). This ensures we are still going through the proper flow to trigger a transition.I want to get your thoughts on this solution. Does this approach fit the intended usage of Transition nodes?
The text was updated successfully, but these errors were encountered: