Interactable - component to mark an entity that can be interacted with
InteractFocus - An entity that can focus on an interactable object
Have a script associated with the PlayerView component that will highlight an object the player is looking at. The way this should be done is to draw a ray cast from the player's camera position (Computed from PlayerVeiw), have the raycast ignore the player itself (Using the SelfFilteringHitCollector), then detect if the object hit has a component called Interactable.
There should be a system to handle this that takes in a PlayerView and InteractFocus and draws a raycast from the player camera position in the direction the player is looking. Then the hit object should be marked in the InteractFocus component of the player.
There should also be a local (not associated with the server, client side only) feature associated with the Interactable object to mark if the object is focused.
Create the following components
Have a script associated with the
PlayerView
component that will highlight an object the player is looking at. The way this should be done is to draw a ray cast from the player's camera position (Computed fromPlayerVeiw
), have the raycast ignore the player itself (Using theSelfFilteringHitCollector
), then detect if the object hit has a component calledInteractable
.There should be a system to handle this that takes in a
PlayerView
andInteractFocus
and draws a raycast from the player camera position in the direction the player is looking. Then the hit object should be marked in theInteractFocus
component of the player.There should also be a local (not associated with the server, client side only) feature associated with the
Interactable
object to mark if the object is focused.