Highlighting vs Selection
intermediate conceptsHighlight Plus · Core Concepts
Highlight Plus distinguishes between two modes of highlighting: Highlighting (hover/proximity) and Selection (click/toggle). Understanding the difference lets you build intuitive selection systems for your game.
Highlighting vs Selection
| Feature | Highlighting | Selection |
|---|---|---|
| Trigger | Mouse hover, proximity, or scripting | Mouse click or scripting |
| Duration | Temporary — ends when trigger stops | Persistent — stays until deselected |
| Profile | Uses the object’s main Highlight Effect profile | Uses a separate Selected Profile (if assigned) |
| Multiple objects | Only one object highlighted at a time (by default) | Multiple objects can be selected simultaneously |
Highlight Manager vs Highlight Trigger
There are two ways to enable automatic highlighting and selection in your scene:
| Component | Scope | Best for |
|---|---|---|
| Highlight Manager | Scene-wide. Highlights the object under the pointer with a single raycast or, in Proximity mode, the nearest object around the player. | Scenes where most objects share the same interaction rules. |
| Highlight Trigger | Per-object. Each object controls its own input detection (raycast, collider events, or volume-based). | Objects that need individual trigger settings, custom cameras, or volume-based proximity detection. |
You can use either one or combine both. HighlightTrigger takes priority on the objects where it is attached.
Proximity Detection
Set the Highlight Manager’s Detection Mode to Proximity to highlight the nearest object around the player instead of the object under the pointer, for example to show what can be picked up. Available since version 34.5.
| Option | Description |
|---|---|
| Proximity Center | Center of the search, usually the player or its camera. If empty, the camera is used. Colliders on this object, its parents and its children are ignored. |
| Proximity Radius | Maximum distance from the center to an object. |
| Proximity View Angle | Only objects within this angle from the forward direction of the center are highlighted. 360 means all directions. |
| Layer Mask | Layers of the objects that can be highlighted. Use a dedicated layer for interactable objects: with Everything, the floor and walls near the player can be highlighted. |
| Line Of Sight Blockers | Objects on these layers between the center and an object prevent it from being highlighted. Set it to Nothing to disable the check. |
Only the nearest object is highlighted, and only objects with a 3D collider are detected. To exclude an object, enable Ignore on its HighlightEffect or return false from OnObjectHighlightStart, and the next nearest object is highlighted instead. Read highlightedObject to know which object is highlighted, for example to pick it up with a key. Demo scene 7 (URP edition) shows this setup.
Setting Up Selection
- Add a Highlight Manager (scene-wide) or a Highlight Trigger (per-object) to handle input detection.
- Create a Selection Profile — right-click in the Project window: Create > Highlight Plus > Highlight Profile. Configure the desired selection appearance (e.g., thicker outline, different color).
- Assign the profile — on the Highlight Manager (or Highlight Trigger), assign your profile to the Selected Profile field. Optionally also assign Selected And Highlighted Profile for the combined state.
- Enable click-to-select — tick Select On Click on the same component.
Selection Options
The selection feature is configured on HighlightManager or HighlightTrigger, not on the per-object HighlightEffect component.
| Option | Component | Type | Description |
|---|---|---|---|
| Select On Click | HighlightManager / HighlightTrigger | bool | When enabled, clicking the object selects it. |
| Toggle | HighlightManager / HighlightTrigger | bool | When enabled, clicking a selected object deselects it. Without it, clicks accumulate selections. |
| Single Selection | HighlightManager / HighlightTrigger | bool | Only one object can be selected at a time. When a different object is clicked, the previous selection is cleared. |
| Keep Selection | HighlightManager / HighlightTrigger | bool | Preserves selection when the pointer leaves the object. |
| Selected Profile | HighlightManager / HighlightTrigger | HighlightProfile | Profile applied while the object is selected (and not highlighted). |
| Selected And Highlighted Profile | HighlightManager / HighlightTrigger | HighlightProfile | Profile applied while the object is both selected and highlighted. |
| Highlighted | HighlightEffect | bool (property) | Current highlight state. Set via effect.highlighted = true or SetHighlighted(true). |
| Is Selected | HighlightEffect | bool (property) | Current selection state. Read or set via effect.isSelected. |
Scripting Selection
Selection is driven by HighlightManager at the scene level. See Scripting Support — HighlightManager Selection Handling for the full API and code samples.
Quick reference:
// Through the Manager (recommended)
HighlightManager.instance.SelectObject(transform);
HighlightManager.instance.ToggleObject(transform);
HighlightManager.instance.UnselectObject(transform);
HighlightManager.instance.UnselectObjects();
// Direct property on the effect (no manager needed)
HighlightEffect effect = GetComponent<HighlightEffect>();
effect.isSelected = true; // select
effect.isSelected = false; // deselect
bool selected = effect.isSelected;
Tips
- If no Selected Profile is assigned, the selected state uses the same appearance as the highlight — only the persistence differs.
- Use different colors or outline widths in the Selection Profile to make it visually distinct from hover highlighting.
- Enable Toggle to let a second click on a selected object deselect it. Combine with Single Selection on HighlightTrigger to allow only one selection at a time.
- Selection state persists across highlight/unhighlight events — a selected object keeps its selection appearance even when not being hovered.
Next Steps
- Settings Reference — full list of all Highlight Effect options
- Scripting Support — complete API reference
- FAQ — common questions
Suggest an improvement
Help us improve this documentation page.