Denotes when the HMD is colliding with valid geometry.
- Place the
VRTK_HeadsetCollisionscript on any active scene GameObject.
- Ignore Trigger Colliders: If this is checked then the headset collision will ignore colliders set to
Is Trigger = true.
- Collider Radius: The radius of the auto generated sphere collider for detecting collisions on the headset.
- Target List Policy: A specified VRTK_PolicyList to use to determine whether any objects will be acted upon by the Headset Collision.
public bool headsetColliding- Determines if the headset is currently colliding with another object. Default:
public Collider collidingWith- Stores the collider of what the headset is colliding with. Default:
HeadsetCollisionDetect- Emitted when the user's headset collides with another game object.
HeadsetCollisionEnded- Emitted when the user's headset stops colliding with a game object.
VRTK_HeadsetCollision_UnityEvents component to
VRTK_HeadsetCollision object allows access to
UnityEvents that will react identically to the Class Events.
- All C# delegate events are mapped to a Unity Event with the
Collider collider- The Collider of the game object the headset has collided with.
Transform currentTransform- The current Transform of the object that the Headset Collision Fade script is attached to (Camera).
public virtual bool IsColliding()
trueif the headset is currently colliding with a valid game object.
The IsColliding method is used to determine if the headset is currently colliding with a valid game object and returns true if it is and false if it is not colliding with anything or an invalid game object.
public virtual GameObject GetHeadsetColliderContainer()
GameObject- The auto generated headset collider GameObject.
The GetHeadsetColliderContainer method returns the auto generated GameObject that contains the headset collider.
VRTK/Examples/011_Camera_HeadSetCollisionFading has collidable walls around the play area and if the user puts their head into any of the walls then the headset will fade to black.
Updated less than a minute ago