Trying to make a simple shift stick for 3d vehicle

Godot Version

4.7.1

Question

Trying to figure out the best way to create 3d first person vehicle controls where the player can shift gears by clicking and holding a shift stick.

So obviously the shift stick should only be able to move within one of the slots as shown in the picture. It seems like the simplest way to do it would be to just give the shift stick and the h-pattern shown in the picture collision shapes. I tried that and made the shift stick a character body 3d. It works fine when the vehicle body is stationary but glitches when it moves.

Based on what I’m reading it seems generally agreed that having a vehicle body 3d parented to a character body 3d is bad practice. Just seems like there should be a simple way to get the functionality I’m going for. I can do it by making the shift stick a regular node3d but it seems like it’ll take a lot more code than using collision shapes.

Maybe I’m missing an easier way to do it. Any thoughts?

Unless you’re trying to intentionally make the game difficult to control in the vein of games like QWOP, I think you should seriously reconsider your user interface. Real stick shifts “work” as a UI because they are located at a fixed location relative to the driver and because they give the driver tactile feedback, allowing the driver to navigate them purely by touch while keeping their eyes on the road. Trying to control a stick shift with a mouse is extremely difficult even if the player gives it their full attention.

If you want to simulate the feeling of a stick shift in a game without making the game impossible to control, I recommend a system using arrow keys or similar input. Move one full “step” each time an arrow key is pressed. No need for physics.

Good points, I can appreciate that perspective. I hadn’t really considered how difficult it’d be to control beforehand. Been a while since I drove a stick shift car :sweat_smile:

I’d recommend using the gears as an index in an array. That way you can apply different speed multipliers to each gear.