The Animation-state_machine error , PLEASE HELP !

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By EmileBowtie

Hello everyone! Can you please help me?
So, I decided to create a second segment for the game in order to add variety and make it more interesting.

The transition from the default segment to the ‘rope_segment’ seems to be successful. However, for some reason, returning from it to the regular segment creates a certain problem.

Basically, when transitioning to the ‘rope_segment’, the variable ‘rope_segment’ becomes true, and the counting of ‘rope_segment_count’ starts.enter image description here

And when ‘rope_segment_count’ reaches a value of 10 or more, the following condition is triggered -


enter image description here

So basically, the count stops because it can only go as long as ‘rope_segment’ is true, and the value itself is reset to 0.
After that, a signal called ‘switch_segment’ is emitted.
This signal triggers a reaction in the game’s floor, as when the ‘rope_segment’ begins, the floor disappears, and it should reappear at the end.
Therefore, a function like this is triggered -

enter image description here

The “ComeUp” animation should start , and when it ends the floor scrolling animation should start . However, for some reason, after the completion of the ComeUp animation, scrolling does not start.
The animation simply gets stuck at the ComeUp stage.

Here’s the animation player and animation tree preview if you need it :

What does the error say, and is the error on the line state_machine.travel("ComeUp")? Regardless, the likely problem is the animation can’t transition from one state to another; either it can’t figure out how to get from one state to the next (there’s no path to the next state) or perhaps the next transition is misspelled (or even missing)?

spaceyjase | 2023-05-19 11:13

There is NO error in editor ! Its not the kind of error that the debugger shows you and you fix it , i would’ve figured it out weeks ago .
About the transitions , i just checked everything and the grammar is correct , to be sure i copied and pasted the names on the animations from the animation player . And i reconnected the animations in the animation tree , so i have no frickin idea what’s the problem . I’m so sad , I’m stuck with this bull crap for 2 weeks now !
I will spend my whole tomorrow trying to solve it using chatgpt , and re-writing huge chunks of code together .

EmileBowtie | 2023-05-22 19:07

That seems a little extreme. Perhaps ask how does it transition from the state it is stuck in? And if it does transition, could it be returning to the state again quickly? These can be debugged using breakpoints if the code is changing state (e.g. travel) or even just printing the state each time.

I don’t see where the state changes from “ComeUp”; there’s not enough information. Certainly the state isn’t configured to change in the editor so perhaps there’s no code to change to another state. Perhaps try walking through the code and explaining the problem to someone as they watch.

spaceyjase | 2023-05-22 20:23