Doubt regarding the contents in buildingescape/opendoor.cpp

In the lecture 107 Using Trigger Volume Ben gets these in his opendoor.cpp already but in my program of opendoor.cpp .I cant find these
AActor* Owner = GetOwner();
FRotator NewRotation =FRotator(0.f, -60.f, 0.f);
Owner->SetActorRotation(NewRotation);
Is its supposed to be present their by itself or I am supposed to write it into the program.
after writing it because GetOwner() is not diffined it shows an error.
I will appreciate some help.

For GetWorld(), I use this in the cpp file:

#include "Engine/World.h"

.

You may have to include another #include for each method used from GetWorld()… example:

GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(...)

may need

#include "GameFramework/PlayerController.h"

.

When you go to use GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(…) and it doesn’t show anything or you see a red underline then you’re possibly missing a header (either that or you have a code problem). You have to search the internet for the method in unreal docs and find the correct header.

1 Like

That was added several lectures before, “Moving Objects with C++”:

1 Like

This topic was automatically closed after 7 days. New replies are no longer allowed.

Privacy & Terms