I regularly create interaction systems during my homework projects. I always design them to be easy to use and simple to iterate.
Whether I use Unity Engine or Unreal Engine, I always take the same approach.
Interaction System


I am creating an interface that contains functions to detect when the player character passes by the interactive object and when they interact with it.
Next, I manage detection within the player character. When it collides with an interactive object, I add the reference for that object to a list of interactive objects. Once the player tries to interact, I check the list to see if there is at least one interactive object present. If so, I call the object's OnInteracted() function. What happens once the player has interacted with the object is determined by the object's code.





