ATriggerVolume not accepted

Hello everyone,

I have a problem with a Triggervolume i created in the editor and that makes me some trouble in C++.

In more detail:
I created the TriggerVolume in the editor and wanted to create a simple pointer like

ATriggerVolume* MyTrigger;

in Code, but VS did not accept it as valid code and intelliSense isnt suggesting it too. I tried it in a simple class directly inheriting from AActor and in one class inheriting form UActorComponent.
The odd thing is, that I saw it working in a very simple Tutorial like this and that i have another project with nearly the same classes inheriting from AActor and UActorComponent which accept ATriggerVolume.

The problem seems so basic, but i couldnt solve it until now. Can someone please help or guide me into the right direction.
Thank very much!
A_nde

Hey a_nde-

I’m not sure what tutorial you’re referring to however for a class inheriting from actor, you should be able to use a UBoxComponent* in place of a trigger volume. If you setup the box component, you can add code or set it up in blueprints to respond to overlap events as a trigger volume would.

Cheers

Hi ,
Thanks for your answer. I know there are alternatives to TriggerVolume, it just bugs me that i cant find a way to make it working. Ben Tristem did it in his course by the way.
Cheers ande

Found it finally. In YourProjectName.h just change

#include "Engineminimal.h"

to

#include "Engine.h"

and it works.
cheers ande

1 Like

in 4.16.0 I changed #include "CoreMinimal.h" (to Engine.h) and it worked. Thanks!

1 Like

Thanks it worked with me I’m in Version 4.17 and I changed [ #include “CoreMinimal.h” to #include"Engine.h] and it worked .
thanks alot dude!

I can confirm changing “CoreMinimum.h” to “Engine.h” solves it for me. It appears that since version 4.17 they have sped up the compiling process by reducing the amount of header information stored in .h files. Unfortunately it appears the user has to learn which .h files to use or replace for necessary functions to work.

Does anyone know a way to force all new classes I create to automatically include certain headers? Such as “Engine.h” or other necessary .h files? If you do, please email me at eldridge.felder@gmail.com

Thanks!

I’m using UE 4.17.

Instead of:

#include "Engine.h"

which will be taking quite long time to Build.

Try:

#include "Engine/TriggerVolume.h"
#include "CoreMinimal.h"

This can cut down the time required to Build.

You can refer to the UE documentation for the path of the library.
https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/ATriggerVolume/index.html

1 Like

i’m use the version 417 ,It works, thanks

Thanks… It worked :slight_smile:

in default it’s not including header, so u need to include it manually

#include “Engine/TriggerVolume.h”
including this will work fine