[VR Development] [Unity] Two methods to achieve non-penetration through walls

【background】

Some fans asked backstage how to solve the problem of wall penetration. They hope to avoid wall penetration. It is too unreal and destroys the immersive experience. Let me summarize it here.

【Two methods】

I only talk about the principles here, because there are various means for implementation, and different SDKs also have different specific methods, but in principle there are two common methods:

  1. A relatively stupid way, a formal solution, is to make the user's field of vision go black after the collision.
  2. A more effective method is to bind the HeadSet to a Collider representing the user's body. When the Collider is blocked by a wall, etc., causing the distance between it and the HeadSet to increase, the Rollback method is triggered to reset the position of the HeadSet to the blocked Collider. s position.

Guess you like

Origin blog.csdn.net/weixin_41697242/article/details/134836563