imjp94 / gd-YAFSM

Yet Another Finite State Machine for godot
MIT License
534 stars 25 forks source link

StateDirectory.get_current_end() doesn't work as expected in godot4 #63

Closed chunhaqiushif closed 1 year ago

chunhaqiushif commented 1 year ago

Sorry to bother you.

From Godot 3.x to 4.x, has there been any modification to string.right()? I cannot get the value of right(0) in 4.x, whereas it was possible in 3.x.

current_path = “Idle”
return current_path.right(current_path.rfind("/") + 1)
//return "Idle" in v3.5.2 but return "" in v4.0.3

This problem affects the return value of get_current_end() in StateDirectory.gd, making it impossible for me to get in any state using the way of match to_dir.next() just like the demo.

piratesephiroth commented 1 year ago

Yes. In 4.x it returns a substring of the specified length from the end of the string (which makes more sense than the 3.x behavior).

imjp94 commented 1 year ago

This remind me to port the demo to godot4