Programming Documentation

logo

Programming Documentation

Search
Light Mode
Contact Us

Contact us

No results for your search.
Sorry, an unexpected error occurred

For the player to be able to interact with any object (slimes, benches, bushes) they need to have an Interactable component attached.


How It Works

The PlayerInteractionFinder script uses a Raycast from the player Transform to detect any Gameobjects with Interactable components. When it finds one it triggers the StartLookingAt() UnityEvent on the Interactable script which activates the InteractionsViaInputActions script, this script handles the UI prompt, the interaction triggering and the button prompts.


The Interaction

The Interactable.cs, PlayerInteractionFinder.cs, and InteractionsViaInputActions.cs all use the Interaction class. Let's break down what that class contains.



On This Page