RaycastInteractor
Namespace: FireSoftworks.Interaction
Assembly: FireSoftworks.Interaction
Type: Class
Implementation of Interactor that uses 3D Raycasting to detect interactable objects. Perfect for first-person or third-person 3D games.
[DefaultExecutionOrder(-10)]public class RaycastInteractor : InteractorBase, IInteractorMethods
DetectInteractable()
Performs a raycast from the camera center to detect interactable objects.
protected virtual void DetectInteractable()Update()
Polls the raycast every frame to update the focused target.
protected virtual void Update()Fields
interactableMask
LayerMask determining which objects can be interacted with.
public LayerMask interactableMaskinteractionRange
[Header("Raycast Settings")]public float interactionRangeplayerCamera
The camera used to determine the raycast origin and direction.
public Camera playerCamera