Description

It seems upon reopening a project with State Trees, they don't always keep their last compiled state or recompile when the project is loading up. Same issue occurred when I removed a Task from a State in a State Tree and reopened the project; The task was executed again even though it didn't exist in the State's details anymore. Upon recompiling, it no longer occurred.

Repro Rate: 2/3 (Issue isn't always consistent.)

Steps to Reproduce
  1. Create a new Third Person BP project
  2. Enable the State Tree plugin
  3. Create and open a new Blueprint based on StateTreeTaskBlueprintBase, named ST_MyTask
  4. Override the EnterState function
  5. In-between the EnterState & Return Node, print out "State has been Entered"
  6. Save & Compile
  7. Back in the Content Browser, create and open a new State Tree
  8. In the StateTree panel, change the Schema to Brain Component
  9. Click the Add State button and name the new state Base
  10. Add another state named Child, making it a child of Base
  11. Select Base State and look in Details
  12. In Tasks, add ST_MyTask as a task
  13. In Transitions, add a transition to goto the Child state On Completed
  14. Select Child State, and add the ST_MyTask to it aswell.
  15. Save & Compile
  16. Back in the Content Browser, create & open a new Blueprint based on AIController
  17. Add the State Tree Brain component and assign your State Tree in Details.
  18. Drag a reference of the State Tree Brain component into the Event Graph
  19. From the reference, drag out and place a "Start Logic" node
  20. Connect the Begin Play node to the Start Logic Node
  21. Save & Compile
  22. Back in the Content Browser, duplicate BP_ThirdPersonCharacter and rename it to AI_BP_ThirdPersonCharacter
  23. Open AI_BP_ThirdPersonCharacter
  24. Select AI_BP_ThirdPersonCharacter (Self) in the Components hierarchy
  25. In Details, set the AI Controller Class to MyAIController (Or whatever you named your AI Controller)
  26. Compile & Save then place the AI_BP_ThirdPersonCharacter into the scene
  27. Play in Editor
    • Observe: "State has been Entered" should be displayed TWO times in the top-left!
  28. Save & Quit out of the project.
  29. Reopen the project
  30. Play in Editor again

Results: "State has been Entered" does not print out, requiring recompilation of the State Tree.
Expected: "State has been Entered" prints out two times and the State Tree successfully starts it's logic.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-150947 in the post.

1
Login to Vote

Duplicate
ComponentUE - AI - StateTree
Affects Versions5.0
CreatedMay 3, 2022
ResolvedMay 6, 2022
UpdatedJun 1, 2022