Intellisense can't find GetWorld() members

First off, incredibly good course. A pleasure to attend.

The problem: during the Trigger volume section, when attempting to find the pawn using GetWorld() Visual Studio gives an error: no members.

I’ve tried all manner of fixes: deleting the browsing database, rescanning the project. Nothing seems to work. I can write the code with ActorThatOpens = GetWorld()->GetFirstPlayerController()->GetPawn(); It compiles and runs. Just intellisense balks and finds nothing.

As this is an unreal course, not a VS course, I’m thinking of just cloning a good version and continuing.

Also, when attempting that with SourceTree is errors out. The clone succeeds from the command line.

You would need to include the headers for the types you are using. When you do

GetWorld()->

You are accessing members on the type returned by GetWorld() which means you need the header for that type for intellisense (and possibly the compiler) to know what members that type has.

To get the header path just Google the typename, maybe add “ue4” to get the docs page, scroll to the bottom and you’ll find the header location. Anything in Public or Classes is in your include path so you only need the relative path after that.

e.g. The docs page for UWorld lists

Runtime/Engine/Classes/Engine/World.h

So “Runtime/Engine/Classes/” would be in your include path, meaning you would just need

#include "Engine/World.h"