Possible to avoid looking through meshes?

Hi there,

Possibly a noob question. But is it not possible somehow to limit a camera to not clip through meshes? So you can’t look though a wall ie. The only way i’ve found to do this, is to push back my player in the opposite direction of the hmd movement, but it seems really weird doing that. Other solution i’ve seen, is where people teleport you back to a last valid location, but again, that’s also anoying. I would really just like a way to override the camera position to respect a collision. Hope there’s a solution, and it’s just me having a noob moment.

/Jonas

So what are you looking to happen when the player does try to look through a mesh? You can stop the camera from going through the mesh but that doesn’t stop the player in real life so you still have a weird movement where in the real world the players head is moving forward but in the VR world the players head has stopped.

Yes. Combined with a postprocess and sound occlusion, it will give the player a clear indication that its not possible to peek through the wall. There are gonna be a slight disconnect for sure between rl and ingame, but with the tests i’ve done with ie holding physical objects towards other meshes, where a disconnect will also happen, it feels quite natural. Atleast more, than things passing through each other.

So is it possible to override the locationdata on the camera component, so it respects a parent position (with collision)?

VR Expansion Plugin has this build in

You mean this: VR (OpenVR) Expansion Plugin?

I looked at it briefly earlier, but could only find the part where the player kinda pushes himself back when intersecting with a wall or something. Are we talking about the same? I just re-played a bunch of vr games to see how they deal with it, and as far as i can tell, most games either ignore clipping, or they teleport you back to a safe spot and/or applies a darkening/blur postprocess effect.

Yes I meant the push back. It might not feel pleasant but trying to headbutt a wall is painful in real life too

Some people don’t like the push back, but in that case I suggest fading out the view so it doesn’t bother them but still keeping the collision.

Most from what I have tested don’t have any issue with the push back though.

Ok. So i assume from that answer, that its not possible to override the camera position.

Im gonna experiment some more with fade out, since i wanna be able to collide with walls but still wanna be able to peek over a table (driving the capsule position from the hmd would collide with the table).

I suggest the push back, the “fade to black” when the camera overlaps collision is disorienting. I tried that a long time ago before finding mordentral’s wall repulsion solution which is fantastic. There would be times when the player would fade out and not understand why, and even worse get stuck with a black camera view.

Just some thoughts,

Cheers,

I’ll post a setup i did later on, with wall repulsion. Its blueprint somewhat equivalent to mordentrals plugin with a twist i think, all though i havent looked at how he did.

Here’s a demonstration of the setup i made. Let me know what you think: HTC Vive - Roomscale moving and collision experiments - YouTube