my current solution is very not optimal as it assumes that it implements only one of the interfaces and is generally not good. what is the better way to solve this?
three different classes wanting for a common way to identify them.
many ways you can accomplish that
you can give them each an actor component which has an enum variable. check if actor has component, if it has that component, check what the enum is, and you can switch/select from that.
you can have them inherit from a common class which has the ID variable. Same thing but using component might be a little less restrictive.
you can use an interface just for the ID. Each actor that implements the interface should set its ID variable in the function implementation.
also, be aware, the way your code is now, I don’t think will function as you expect. Whichever of those cast nodes is evaluated last would be the output no matter what.
