@GustavoDBP what I’d do:
- All interactable Actors (like a door, a light switch, a shelf…) have a class component called InteractableActor;
Create an Interface InteractableActor with Interact() function and implement it in your Actors
- When the player looks for the interactable actor and press “F” key, the InteractableActor class attached to the interacted actor will call a function that I have previously defined at the details panel.
When you “collide” with your Actors check if they implement your InteractableActor. Then call Interact().
- I need to have a field in the details panel that allows me to select a function of interaction for each type of interactable object.
In your Door Actor just implement open/close inside Interact() function, same for your Light switch.