Godot Version
4.6
Question
Godot Version: 4.6
Question:
Hello everyone!
I’m currently learning Godot 4.6 and working on my first 2D game.
I’m trying to create a railroad track system where a character riding a cart moves automatically along tracks that go uphill, downhill, and through smooth curves.
I want the cart to:
-
Move forward automatically without requiring directional input.
-
Follow the railroad tracks, including uphill and downhill slopes.
-
Gradually increase speed when traveling downhill.
-
Gradually decrease speed when traveling uphill.
-
Allow the player to jump over obstacles while the cart continues moving forward.
I’m currently experimenting with CharacterBody2D, gravity, velocity, and move_and_slide().
I’m wondering what approach would work best for this type of movement.
Would CharacterBody2D with physics and slopes be suitable, or would Path2D and PathFollow2D be a better option?
I’m still learning GDScript, so any advice, tutorials, or examples would be greatly appreciated.
Thank you!