Player won't move when trying to force teleport via script
Hello everyone,
I'm currently stuck on implementing a player teleportation feature for a Meta Quest 3 application in Unity and would greatly appreciate any help from experienced developers.
What I want to achieve
I want to control the player's position in the VR space. Specifically, I need two main functions:
Prohibit player movement at certain times.
Programmatically force the player to move to a specific coordinate and orientation (a "teleport").
The Problem
I'm unsure of the best practice to achieve this. My attempts have led to issues like the player's position not updating correctly or conflicts with the CharacterController. I want to know if there is a standard, reliable function or method provided by the official SDKs to handle this, which correctly manages the camera offset and physics interactions.
What I've tried (from my development log)
Initially, I tried to directly modify the position using a custom script, but I suspected a conflict with the CharacterController.
I also tried using the CharacterController.Move() method, but that did not solve the issue.
My current leading theory is that the root cause is a script execution order conflict within the same frame.
Development Environment
Unity: 2022.3.22f1
SDK: Meta XR All-in-One SDK (v77.0.0), OpenXR Plugin (v1.10.0)
Target Platform: Meta Quest 3
My Question
Is my understanding correct that VRChat APIs like Networking.LocalPlayer.TeleportTo and Immobilize will not function correctly, or will conflict with a standard CharacterController, in a standalone Quest environment?
If so, I would be very grateful for guidance on the standard, recommended method (e.g., functions or assets) for safely and reliably controlling the player's position (both teleporting and immobilizing) via script in Quest development.
(Translated by Gemini AI. JP => EN)
Update: I have now resolved this issue.
My solution was to move the entire scenery/environment around the player, rather than attempting to move the player character itself.