Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"


Hello. I was watching a tutorial about a simple game and it uses trigger. This is the code that confuses me.

   void TriggerEnter(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

Now my question is, what are these arguments in that TriggerEnter function. Im just learning so dont mind this question...THANKS...

Product Version: UE 4.21
more ▼

asked Dec 12 '18 at 08:10 PM in C++ Programming

avatar image

3 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

OtherActor - Actor that triggered the event

OtherComp - Component of "OtherActor" that triggered the event

OtherBodyIndex - Index number of actor that triggered and event if there is more then one in trigger area

bFromSweep - Is true, if actor that triggered the event was sweeping thru trigger area (https://www.unrealengine.com/en-US/blog/moving-physical-objects)

SweepResult - Structure containing all the collision data of object entering the trigger area, precise positional data and so on (http://api.unrealengine.com/INT/API/Runtime/Engine/Engine/FHitResult/)

In UE4 terminology "Other" in event arguments means "something" that triggered the event

more ▼

answered Dec 13 '18 at 04:45 AM

avatar image

36.6k 932 169 1111

avatar image GameGod786 Dec 13 '18 at 12:31 PM

Im a beginner so just one last thing i wanna ask. Could you explain UPrimitiveComponent. I know a little bit about it but i dont have the exact info that lets me use it whenever i want.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question