Hello!
I’m trying to make a function which changes action by hit object and use “OnHit” function.
Some objects are made from [Y class] inherited “AActor” class.
“OnHit” function has “AActor* OtherActor” arugement, but I can’t cast “AActor*” to [Y class]*.
So I can’t get information of hit object.
casting can not work with runtime classes, it needs to know what to cast to at compile time
sounds like what you want to do is use an interface
basically all your classes that should DoSomething need to implement that interface and in the hit you check if the object implements it, and if so call it