Setting up a Player to auto-detect Hotspots

By default, Hotspots are detected by hovering the cursor over them. Alternatively, this can be based on their proximity to the Player. This is especially useful for games played with a Touch-screen or keyboard that don't rely on a cursor.

Begin by going to the Settings Manager, and changing the Hotspot detection method to Player Vicinity. If you are making a game with Direct- or First Person-control, you will be shown a new field: Hotspots in vicinity. When left at it's default value of Nearest only, only the Hotspot closest to the Player will be detected.

If changed to Cycle Multiple, the Player will be able to switch between different Hotspots in his vicinity, similar to the controls in Grim Fandago. However, you will need to declare two new Input axes: CycleHotspotsLeft and CycleHotspotsRight.

The Inputs can be added to the InputManager (found in Edit -> Project Settings -> Input) and can be set up as follows, amending the Positive Button values with the keys of your choosing.

Assuming we've already got a Player to work with, place it in your scene or open up its prefab. We'll be detecting Hotspots around the Player with a Sphere Collider, so next add a new empty GameObject as a new child object.

With the empty GameObject selected, add a Sphere Collider. Check Is Trigger in its component, and rename this object "HotspotDetector".

Then, add the Hotspot detector component to it, available from the Add component menu under Adventure Creator → Hotspots → Hotspot detector.

In the Scene window, you should see the Collider's influence represented by a green sphere. The Player will only be able to "see" Hotspots that are inside this sphere, so adjust it's position and size to that it covers an appropriate volume - with the centre just in front of the player.

In the Player Inspector, find the Hotspot detector child field at the bottom and drag the HotspotDetector object onto it. Your Player will now highlight Hotspots as he moves around the scene.

Unity requires a Rigidbody component to be present on at least one of the colliders involved for a Trigger to work - if your Player prefab doesn't have one on the base object, be sure to add this component to your HotspotDetector, and disable gravity on it.