Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene sticks to head depending on head orientation #572

Open
paulmelis opened this issue Nov 25, 2023 · 1 comment
Open

Scene sticks to head depending on head orientation #572

paulmelis opened this issue Nov 25, 2023 · 1 comment

Comments

@paulmelis
Copy link

paulmelis commented Nov 25, 2023

Disclaimer: I've only just started toying around with Godot for XR so maybe I'm doing something dumb.

I've followed the XR tutorials to bring an existing project into XR (Quest Pro), resulting in the following node setup, which is hopefully correct:

image

The scene consists mostly of a 3D map (imported from a glb) and a bunch of objects moving on the map.

Deploying to the headset from the editor works fine and I can look around in the scene for most part correctly. But I'm seeing a weird effect whenever the head look vector points above the horizon (i.e. has a positive Y component): the whole scene (map + objects) instantly sticks to the head from that point on. I.e. the relative transform between head and scene objects stays fixed and the whole scene transforms along with head movement, both orientation and position. Looking down again to bring the head look direction below the horizon releases the scene objects from this lock and they go back to their correct position and rotation.

I'm seeing another weird thing, which might or might not be related, hence mentioning it here. I have an object in the scene that moves over the map, with another object tracking its position by rotating. I use look_at() in the object scripts to accomplish this, but when viewed in XR those look_at() calls have no effect. The same project (without the XR parts) worked fine on desktop, but since I added the XR parts the object orientations are no longer being updated correctly, in effect not changing at all, either in the headset or in the editor. Okay, the look_at() not working was caused by a scale of 1/125 I was applying to the parent of the moving objects (which was there to turn what was essentially real-world size objects into smaller versions for use in XR). Edit 2: ah, look_at() expects global coordinates, wasn't expecting that.

Any ideas what could be going wrong?

This is with a Quest Pro and Godot 4.1.3 on Arch Linux

@paulmelis
Copy link
Author

Just tried https://github.com/GodotVR/godot-xr-template and the game works correctly there, so it seems I have something weird in my own project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant