Download

How can I access to method of c++ class from line trace hitresult

if there is c++ class B

B.h

Class UB: public AActor
{
public:
void func(int a);
}

how can i access method func from FHitResult?

another class
{
void linetrace()
{
FHitresult outhit;
GetWorld()->LineTraceSingleByChannel(…);
}
}

what i can only get is AActor object by outhit.GetActor()

how can i call method func without AActor change?

sorry for broken english

Something like Cast<UB>(outhit.GetActor())->func() ?

thank you for response ill try it