I did not have to include GameFramework/Actor.h

Just a comment…
I did not have to include GameFramework/Actor.h in order for Visual Studio Intellisense to auto complete
for GetOwner()->.

Everything autocompleted (gave suggestions) just fine, and it compiled ok and ran ok.
Not sure why, but, just want to make sure I am doing things in the most proper way.

I am using Unreal 4.25.3 with Visual Studio 2019 on Windows 10.

The include is needed in the header so you can inherit from UActorComponent so including the OpenDoor.h also includes the Actor.

Normally it’s good to avoid including in the header, but when it is needed as it is here, this is the only way.
Good work with this.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms