I start getting a little frustrated right now since I allways get weird compiler issues since the first line of code.
It started with GetOwner() not beeing somehow known to VS2017.
This could be solved by including “Engine.h” in the cpp although it doesn’t work all the time.
Now with the ATriggerVolume there are problems again.
As I ad this lines of code:
UPROPERTY(EditAnywhere)
ATriggerVolume* PressurePlate;
Okay I solved my problem for now.
Instead of Creating a ATriggerVolume Instance I used its parent class AVolume and that works just fine. Just in case anyone stumbles across this as well.
Hello @Luuke_L - I just wanted to mention that it might be wiser to specify it more closely as TriggerVolume, instead of the Volume interface, and just include the header files required for that to work fine.
This way you won’t be able to choose any Volume in the game as a PressurePlate - only TriggerVolumes (which can Trigger things, which is the point of PressurePlate ).
In order to do that - I think it’s best to include “Engine/TriggerVolume.h” header (some people might just include “Engine.h” but I find it to be a little more than is really required).
To be honest I think it’s a good choice, this is caused by not including everything that might be required and including only the minimal set of features.
It’s healthy from the project perspective, less bloat, more precision.
I have this same problem in 4.16.1. The suggestions here didn’t fix it. I tried them all and some of my own. It wasn’t until I tried compiling in the editor that the issues just disappeared completely. I messed around with it a little more and it seems like a bad compile in VS cannot always be corrected in VS. UE compile seems to fix these problems though.
Just like @Bajter suggested, including “Engine/TriggerVolume.h” solved the problem for me. However it wouldn’t compile in Visual Studio but it did compile in the Unreal Editor. Visual Studio also introduced IntelliSense errors on UCLASS() after including “Engine/TriggerVolume.h”. Additional research provided me with the solution for the IntelliSense problem where by restarting Visual Studio, squiggly lines are removed. I’m using VS2017 and UE 4.16.1
The issue I couldn’t solve was that VS doesn’t compile successfully but the editor does:
Can’t seem to get this to go away: Error D:/unrealcourse/projects/Escape/BuildingEscape/Source/BuildingEscape/OpenDoor.h(32) : Error: Unrecognized type 'TriggerVolume' - type must be a UCLASS, USTRUCT or UENUM
I’ve included Engine/TriggerVolume.h at the top of my header file but it still won’t compile, and I have no clue what’s going wrong