Hello!
Today I was trying the Example 1(Basic FSM). In the Time example, if I press "back" when the cube is active, although I went back to mainmenu, the Time FSM still counting. Then when I press "Time" again, the FSM back to work from last time it stoped. So the cube will be active at the begining and become inactive immediately, which is not what I want.
Can I reset a FSM(timer, children active, etc) when get interrupted? Like the "back" button in Example 1. I tried "stop state machine", although I can restart FSM, the states data is not reseted...
Time Transition interrupted and FSM resetについて
Forum rules
Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
- We can not answer your questions about your project specific issues.
- We can not answer your questions on Unity's specification issues.
- Please check Arbor Documentation and ask a question if you still don't know how to use it. If the desired function is not described in the document, it is highly possible that the function does not exist from the beginning, so go to the request forum.
ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
- ユーザー様のプロジェクトの仕様上の問題や設計に対する質問には答えられません。
- Unityの仕様上の問題に対する質問には答えられません。
- Arbor Documentationを確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。
- caitsithware
- 管理人
- Posts: 495
- Joined: 2015/08/17 12:41
Re: Time Transition interrupted and FSM resetについて
Example 1 (Basic FSM) is a simple example and does not implement complex reset processing.
To implement reset, it is better to implement reset state by combining SendTrigger, TriggerTransition, PlayStateMachine, StopStateMachine.
For example, the following FSM.
MainMenu Open
Time Open
Main flow
See Example 14 (Graph Hierarchy) for more information on graph hierarchy.
To implement reset, it is better to implement reset state by combining SendTrigger, TriggerTransition, PlayStateMachine, StopStateMachine.
For example, the following FSM.
MainMenu Open
Time Open
Main flow
- MainMenu FSM : In the Time state, activate the Time object and play the TimeFSM.
- MainMenu FSM : When the Back button is pressed, a "Reset" trigger message is sent to TimeFSM in the ResetTimeFSM state.
- Time FSM : Accept the "Reset" trigger with ResetTrigger in the resident state, and immediately transition to the Reset state.
- Time FSM : Performs reset processing in the Reset state and immediately transitions to the End state.
- Time FSM : Send "End" trigger to MainMenu FSM in End state.
- MainMenu FSM : Reset TimeFSM accepts "End" trigger and immediately transitions to EndTimeFSM state.
- MainMenu FSM : Stop Time FSM and deactivate Time object in EndTimeFSM state. Transition to MainMenu state.
See Example 14 (Graph Hierarchy) for more information on graph hierarchy.
- Attachments
-
- Example_FSMReset_Time.png (124.62 KiB) Viewed 5712 times
-
- Example_FSMReset_MainMenu.png (136.98 KiB) Viewed 5713 times
Re: Time Transition interrupted and FSM resetについて
Hello!
Thank you for the answer. After I reproduce it myself, I noticed I made a big mistake. I used "stop state machine" after the Time gameobject is inactived, that's why the FSM didn't stop...In the mainmenu graph of your answer, I tried to just link "Time" node and "End TimeFSM" node, it still words, and the TimeFSM reseted properly. So the FSM actually can reset it self if it's active , my mistake...
Thank you for the answer. After I reproduce it myself, I noticed I made a big mistake. I used "stop state machine" after the Time gameobject is inactived, that's why the FSM didn't stop...In the mainmenu graph of your answer, I tried to just link "Time" node and "End TimeFSM" node, it still words, and the TimeFSM reseted properly. So the FSM actually can reset it self if it's active , my mistake...