Whats the best type of movment code?

Godot Version

4.4.1

Question

I want to have a adjustable move set so I could easily add animations and add on to the code. My first movement code struggled on adding a roll movement and was very janky. Anyone's intake and advice would be very helpful :grin:

That’s a little difficult to answer; it depends a great deal on what you’re trying to do, how you want to be able to expand in the future, and personal taste.

For example, depending on whether you mean “a person doing a dive roll” or “a plane doing a barrel roll”, the answer could be very different…

2 Likes

I think a good starting point are state-machines

1 Like

Its a person roll because i am making a platformer. So should i stick with the basics?

It’s generally a good idea to stick with the basics on these things until you know that the complexity of more advanced techniques is going to save you more hassle than they cause. If your movement code is turning into an unmaintainable pile of hacks (or just irritating you whenever you have to look at it) maybe go state machine, or even multi-tier state machine. If your needs are simple, though, you’re probably better served by the basics.

1 Like

thank you guys I am learning state machines right now :grin:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.