I have a question about Getting the owner (AActor * Owner)

We usually use AActor* Owner a lot to get the owner, however, if we're already doing code for the door why do we need to find the door using this code? Sorry noob here just would like to know.

Not entirely sure I understand your question. Though If you’re asking why we are using GetOwner(), then it’s because the class we are writing in is an ActorComponent, a component to be added to an actor, not the actor itself.

Thanks for the reply, what I was originally thinking was that the door IS the script when it’s attached to the door, however I realized that the script is a completely separate entity that’s attached to the door. It’s a component, as you said.

Privacy & Terms