https://playground.babylonjs.com/#9K3MRA#488
The state change observable is triggered when you enter XR and so only then will the camera be positioned to a y value of 5 in this case.
I implemented your code in my project and it does set the height initially! Thanks!
I forgot to mention though, that I’m using teleport. So everytime I teleport the height resets.
Is there maybe an observable for when you press to teleport? I would need that for another use case besides teleportation as well.
Now why I want to raise the height is because my meshes are all scaled up. I’m thinking I’ll scale them down so the height question eliminates itself. This way when moving roomscale you also move more realistically around the meshes. Maybe it would be nice to have a parameter for roomscale moving distance. Or rather ‘size’ of the player.
Excellent! BTW there is a before onBeforeCameraTeleport observable also - can be used to determine direction between the 2 points or whatever. You may find it useful.