Reputation: 791
I have just downloaded Google VR SDK for Unity v1.50 today. I cannot set the starting position for camera now. After I pressed play, position that I set will be changed to (x,y,z) as (0,0,0.08). I used Google VR SDK for Unity v1.20 before and it's working fine in the old project I have. Now, I cannot set starting position anymore. Is there a way to set starting point for camera?
Upvotes: 0
Views: 380
Reputation: 1022
As you noted, Unity updates the (local) transform position and rotation of the camera based on the user's head movement and the Google VR neck model.
To set the player's origin so something other than (0, 0, 0)
in world space, attach the camera game object to a new (parent) game object. You can then set the parent transform.position
to the desired origin, which will be the player's (0,0,0). To teleport the player to a new location, set the parent transform position to that location.
If you have a reason to change which direction the player's "forward" direction is relative to your game world, you can also set the yaw component of the parent transform.rotation
. For example, if your controls allow the player to turn 90° left or right, simply change the parent rotation y
component by ±90
based on user input.
When dealing with rotation, make sure you respect system and handle user initiated recentering correctly. See the Daydream app quality guidelines for more details:
Upvotes: 2