How to approach things would really depend on the scope.
- I’d start by creating an enumerator for the items and a blueprint interface for communication; add a function that returns that enum:
- the Flashlight is implementing the interface, and the function returns the object type (don’t forget to set the enum):
- so the player can interact with things in a very generic way:
Now each item class can handle the function the way you need.
Admittedly, there’s more than one way to set this up. But that’s the gist.