Problem calling engine functions

I can’t do this in my Third Person Example code. I can’t set a watch on the GEngine variable in VS2013 either, or step into it with F11.

ULocalPlayer* p = GEngine->GetGamePlayer(GEngine->GetWorld(), 0);
p->ApplyWorldOffset(FVector(0, 0, 30));
ULocalPlayer* p = GEngine->GetGamePlayer(GEngine->GetWorld(), 1);
p->ApplyWorldOffset(FVector(0, 0, 30));

I just get the error message:

UE4Editor.exe has triggered a breakpoint.

I can call these fine-
GEngine->GetFName();
GEngine->GetWorld();

Workaround:
ULocalPlayer* p = GEngine->GetGamePlayer(GetWorld(), 0);

You can call GetWorld() on GEngine, but it won’t return anything because the engine is not part of any one particular world. Therefore, when you call p->AnyFunction() without checking if p is a valid pointer (shame on you lol), it crashes because, of course, p is not valid. However, your “workaround” of calling GetWorld() on the actor it’s on works fine, because that actor is part of a particular world and can return that world.

Thanks for that. No, I just assumed it would work but then, ah, I see there is the whole level/character architecture.