- Comment out the existing logic (except for _nearestInteractable)
- We’re going to re-write Interactor using under-performant code
- Implement the Update method
- Instead of reacting to GameObjects that invoke the “OnTrigger” methods, we’re going to poll the scene for interactables
- In Update, declare and initialize a variable called “interactables” using FindObjectsOfType()
- Like the “GetComponent” methods, Unity has a set of “Find” methods that allow you to search the scene for GameObjects
- These are generally unsafe because you can’t always predict how many objects will actually be in your scene
- Add a foreach that loop that iterates over interactables
- Check if _nearestInteractable is null:
- If it is, set it to the current interactable