UEv4.16.2 does not recognise GetWorld()

Hi,

I can’t get this section to compile, due to issues with the GetWorld(), I am using UEv4.16.2 and was able to use the GetWorld() function in the previous section for the Room Escape, though that was component based so #include “Components/ActorComponent.h” likely covered it? Is there an equivalent for this?

What I have tried:
I tried changing the main BattleTank.h project file to “#include “Engine.h”” as opposed to the “#include “CoreMinimal.h”” that is now in the latest version of UE.

I also tried adding #include “Components/ActorComponent.h”.

I have also tried deleting the .vs files and rebuilding them with the “Generate Visual Studio project files”

Any help would be appreciated! Thanks

After taking a break I realised I am an idiot and tunnelled in on the GetWorld() and missed the brackets off the GetPawn();

I am still getting the error in visual studios but it compiles and works now at least in UE.

Am unsure how to delete this post so have just marked it as solved for now.

Privacy & Terms