Hello forums! I'm trying to lock every axis except the z axis for a button. I want to be able to rotate the button and it still only be able to move on the button's z axis. I tried using the rigidbody axis lock that it has built-in but that does global only. I also tried looking online for solutions but it doesn't seem to be a common issue.

cybereality Yes! It's a 3D button. Specifically for a VR game. I want the button to only move on its local z axis. When I rotate the button, it should be able to move backwards or in its z local axis.

help.mov
3MB

The first button is one that works properly and is axis locked using the global one provided by PhysicsBody3D in a Rigid Body.
The second button is one that works the exact same way except rotated && it doesn't push into the wall.

How are you moving it? You can just move it on whatever axis you choose (for example by using the Basis).

    cybereality I'm moving it by physically pushing the button. No code is interfering with the button besides for an action it does when it's pushed.