Can't figure out how to put XR interactive joystick on RigidBody3D

Godot Version

4.3

Question

I’m trying to add a joystick to a vehicle. I’ve tried to copy the interactive joystick from the XR tools demo as best I can, but when I place it on the vehicle, the vehicle just starts flipping around. I am not very experienced with godot or game development, so perhaps I’ve done something wrong, or else I can’t figure out how to get it right.

I’ve tried searching to find answers to this problem, but have not been able to find what I’m looking for.

– update: more info:
I started by creating an inherited scene of the interactive joystick scene, and then added all the parts of the joystick to the inherited scene, and then I tried to attach that scene to the RigidBody that is the vehicle (it’s sort of a hover vehicle thing, so not a car or airplane; not that it should matter much for the functionality of the joystick. Technically, I actually want more of a flight yoke, but the joystick is the closest option in the tools.). I am using the jolt physics plugin, but I don’t think that is the root of the problem?

I haven’t actually added any code to do anything with the joystick. I figured I should make sure it feels like it’s in the right place first.

The most recent time I tried to figure out if there is something I can do to get this working, I also had visible collision shapes on, and it seems like the handle collision shape isn’t staying attached like I would expect either.

I wonder if your issues are related to the input, or are just purely due to physics.

If your character is placed in the vehicle, but you’re applying the default player body logic in XR Tools, than its likely the player is colliding with your vehicle, and that is causing the vehicle to complete mess up.

It’s a bit of a watch but I did do a live stream on building a simple VR racing game in Godot a little while ago: https://www.youtube.com/watch?v=eWpNwrPTiqw
Might give you some ideas.

This doesn’t use XR tools however, it’s completely scratch build.

1 Like

While I was trying to get this working, at one point I removed the joystick so I could just test the vehicle in VR using the keyboard controls I set up, and that seemed about the same as testing the vehicle outside of VR.

Right now with the way the tools are set up, I get the impression they are meant to be stationary levers and switches, and not meant to be on moving objects. However, I don’t know enough about how the different parts work to be sure.

I’ve been wondering if I should just try to go about doing something from scratch myself, but I wasn’t sure where I would even start with something like that, and so your videos will be very helpful to me there, thank you.