Skip to main content

Player Rig & UI Prompts

NAMESPACEMyDreamGameStudio.InteractAnything
MENU PATHTutorials > Player & UI
COMPATIBILITYUnity 6.0+
DOC VERSION

This tutorial demonstrates how to equip a first-person player rig with the necessary sensors to interact with the world, alongside setting up dynamic Canvas UI prompts.

1. Player Camera & Raycasting​

  1. Select your Player's Main Camera and add the Raycast Interactor component.
  2. Adjust the ray distance (how far the player can reach) and set the Interaction Layer Mask to ensure it only hits valid interactable objects.
  3. Add the Interaction Input component to your player rig. Configure your preferred key bindings, such as the E key or Mouse Click, to trigger interactions.

2. Spatial Scanning​

To allow the game to know what objects are nearby (for proximity outlines or floating UI markers), add the Nearby Interactables Scanner to the player character. Configure the detection radius using the sphere and angle filters to match the player's field of view.

3. UI Configuration​

  1. Open your main Canvas hierarchy.
  2. Add the Radius Finder UI component, which maps world-space interactables to screen-space coordinates.
  3. Assign your custom Interaction Marker prefab to the component.
  4. Add the Interaction Prompt UI component to handle text popups (e.g., "Press E to Open"). You can fully customize these UI markers and text panels to match your game's aesthetic.

4. Testing the Integration​

Press Play and approach any interactable object in your scene. The customized UI prompt will dynamically appear on-screen. Press your configured interact key to watch the system successfully trigger the object's linked events.