Assuming I dont use interfaces
So lets say i have a line trace where i can shoot a weapon from. So there are now barrels and humans and other destructible items in my game world. How should I approach casting that? So for humanoid i wanna cast to enemy NPC and for destructibles I want to cast to destructibles. Should I make a parent class for both and have the parent have receive damage event, but the thing is those 2 are two entirely different things. My current solution is using a sequence with different cast to but I am wondering if thats a recommended approach. So i am casting to enemy npc then the other sequence is casting to destructible and the other sequence pin is casting to another object etc.
- I am also wondering what would be the cleanest way to handle line traces with different set ups. So for instance i want to be able to holster the weapon and use the line trace to talk or interact rather than damaging objects. Should I use a switch enum for that? Also use an enum for the weapon type? (Different weapons have different ranges etc). If someone knows a tutorial or has tips how to handle this without having to cast to each and every class, it would be awesome.