Cast to any Actor?

Hay everyone (°^° ~)

I already posted this on the answer Hub but I kinda have the feeling nobody is really answering questions there since 70% of my questions where answered by myself… ~(^- ^ ~).
So here’s my problem, I want to attach a physics actor to my player so it seems like he is carrying it but therefor I have to Cast to the actor class to disable physics simulation. Simply the problem is that I don’t want to cast to every single possible actor class that my character could possibly carry. So is there a way to do this without casting to every possible class?

Sincerely,

You’d make a base class for all your “carryables”, derive all applicable items from that base class, then you cast to that single base when needed.

…if I understand your question correctly :slight_smile:

Yeah thought about that too, well I guess I’ll go with this solution, thanks mate :wink:

You could also create an interface “carryable” and then implement that in all classes that you want to be able to carry. That way you wouldn’t have to modify the class hierarchy too much.

Yeah, interface is a good idea if you already have a significant codebase built and tested.

@jonimake That is actually a pretty god idea why havent i thought about this, thanks d(^u° d )