- Home /
How to stop seeing through a wall in VR?
I have a scene where I can teleport to anywhere on the terrain. Including vertical walls. When I teleport to another ground location, my camera is off the ground so I won't be able to look through the ground. When I teleport to the wall, my camera sits exactly at the wall so I can see the terrain and inside the building. Any ideas?
I've tried my putting my near view clipping at 0.01
I've tried to set a box / sphere collider on it with a rigid body and my terrain has a mesh collider
It might be I need to add a lerp function?
private void TryTeleport() { if(!m_HasPosition || m_IsTeleporting) { return; } Transform cameraRig = SteamVR_Render.Top().origin; Vector3 headPosition = SteamVR_Render.Top().head.position;
Vector3 groundPosition = new Vector3(headPosition.x, m_Pointer.transform.position.y, headPosition.z); Vector3 translateVector = (m_Pointer.transform.position - groundPosition); StartCoroutine(MoveRig(cameraRig, translateVector)); } private IEnumerator MoveRig(Transform cameraRig, Vector3 translation) { SteamVR_Fade.Start(Color.black, m_FadeTime, true); yield return new WaitForSeconds(m_FadeTime); cameraRig.position += translation; SteamVR_Fade.Start(Color.clear, m_FadeTime, true); m_IsTeleporting = false; }
Did you find a solution that works? I have a similar issue too. Not nice being able to teleport to the side of a wall. They should be better than that.
Your answer
Follow this Question
Related Questions
SteamVR: How can I use SteamVRLaserPointer with Objects that are interactable( such as throwable)? 0 Answers
Getting started with VR (Vive) and unity 5.5.0 0 Answers
user input 1 Answer
Double Screen Camera (VR , Cardboard vision) Same Camera Side by Side 0 Answers
How to make an OVR Camera Rig LookAt a particular direction? 4 Answers