May 2, 2021

Tool Guide – Player Detector

Latest Version: 0

The Player Detector is similar to the teleporter, except that instead of performing a single function, it invokes a Unity Event that lets you decide what you want to happen.

The tool itself makes a collider the event you want when a player’s head or hands are detected within the collider.

How to use

  1. Create a box collider, sphere collider, or other type of collider inside your scene.
  2. Drag and drop the Player Detector tool onto the same object with the collider on it.
  3. Define what should be detected, and what should happen when the player enters and/or exits the collider.

If you would like a more extensive guide on this tool, it is used as an example in the Unity Events tutorial.

Section Information

Options

 

The options section contains 3 parts

  • The What to Detect dropdown
  • The What happens when that is detected event creator
  • The What happens when that exits event creator

The What To Detect Dropdown lets you determine what the tool is looking for. Conceptually, detector sensors like this look for penetrations of the collider by specific objects. This dropdown lets you determine what penetrations are eligible for setting off an event. The options are:

  • Only Head. Only detect the player’s head. Ignore the player’s hands and other tracked devices.
  • Head and Tracked Devices. Detect the player’s head, but also detect any tracked devices like the player’s hands.
  • Tracked Devices Only.  Ignore the player’s head.

The What Happens when that is detected event creator is a field where you can specify one or more Unity Events to fire off when the collider detects an eligible thing (head, tracked devices, or both) going from outside the collider to inside of it.

The What Happens when that exits event creator is a field where you can specify one or more Unity Events to fire off when the collider detects an eligible thing (head, tracked devices, or both) going from inside the collider to outside of it.