Hello Godot community. I’m new here, and I’m working on a VR/XR project at the moment.
Here’s my biggest current issue:
I managed to export the project to android Meta Quest as an apk file, which I sideloaded and installed.
However when I run it on the quest (while wearing it obviously), the player almost instantly starts sliding backwards. If I stand very still and just move and turn with the joysticks on the controllers, nothing happens, or I only slide very slowly.
I also have XR simulator installed and this issue doesn’t exist there.
This is my setup:
Made a new project in godot, installed XR tools, vendor plugin and XR simulator. Enabled XR and vendor plugin, made an autoload for the XR simulator, ran the XR tools to “enable” XR and name the physic (collision) layers.
I’m using the VR staging template, with a main scene, a zone_base scene, different zones, climbing points, 2d_in_3D_viewport for several control node based UIs.
Another issue I have is that I’d like to keep the jump and teleport functions use the primary trigger, but not while the pointer detects a 2D_in_3D_viewport (UI) or a climbable or pickupable object (although I’ve worked around the climbable and pickupables by using the grip instead of the trigger).
My biggest issue is that the player automatically starts sliding until he kinda catapults out of the floor (if there is no collisionshape boundary).
Does anyone know what might cause this? Thank you for your time and effort.
Generally speaking when something like this happens you’ve not setup the correct physics layers for some object.
The problem in Godot is that it now allows you to create nodes through the + button for any script that has a class_name, but there are many scripts in XR Tools that also have an accompanying scene that sets up the correct values for all the built-in properties. There currently isn’t a way to overrule default values for built-in properties in GDScript.
The result is that you end up with the physic layer set to 1 for say one of the features you can add to your XRcontroller node, and now your hand collides with the player body and pushes the player body backwards.
So you need to check through some of the things you’ve added, and make sure they use the correct physics layers and masks, or re-add them through their scenes instead of just adding the node.
Apologies for the late reply. Thank you and you were right. The problem was in a physics layer that wasn’t configured properly, and upon inspection, also gave the same problem in the simulator once I moved the hand close enough to intersect with the body.
I have more questions, but it’s really late and I need to sit down for this. I wish this forum was accessible at work. It’s so helpful.
I’ve instanciated several viewport_2d_in-3d.tscn nodes as wrist panels on the left hand controller, with the idea of one small, main ui with just a few buttons that make larger panels pop up,
and I’ve added a node3D with as it’s children a subviewport with Camera3D as child, and sprite3D with viewporttexture as a sort of handheld camera. I’ve had to look for a script to copy the Node3D global_transform for the camera3D because it was stuck the the subviewport, but other than that it’s a simple setup.
So basically a group of UI panels on the left hand, and a camera on the right hand.
You press a button on the small wrist UI to get a Tool panel with a camera button, and you press a button on the Tool panel to show/hide the camera (really just the sprite3D)
I’ve managed to connect signals from buttons that toggle a global variable. And then using:
if global.camviz:
(tab)$Sprite3D.show()
if not global.camviz
(tab)$sprite3D.hide()
that works for the camera. However, for the panels the collision for the pointer is still there. So instead of $nodename.Show() I’ve tried using:
if Global.ui_tools:
(tab)add_child(get_node(“Wrist-Tools-Menu”))
if not Global.ui_tools:
(tab)remove_child(get_node(“Wrist-Tools-Menu”))
This removes the panel, but doesn’t add it back when I press the button for it.
What would be the right way to do this? If you need more information I’m happy to help.