I have a class called AMyDoor(derived from AActor) parent of a door blueprint and I want to get an object of AMyDoor whenever the PlayerController hit it with raycast.I can get the AActorcomponent of the Door object using the HitResult.GetComponent() and HitResult.GetActor() but not the AMyDoor component. I cannot use FindComponentByClass, how do I get the refernce of my custom class instead of its parent class?
I was doing HitComponent->GetComponent()->GetOwner() and casting like you mentioned…but the Owner was null, so whats exactly is difference between between GetActor() and GetOwner()?
If im not mistaken GetOwner() in scene component will return other component that this component is attached to only root component will return AMyDoor here, GetActor() will always return a actor that was hit so use that