x

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"

OnComponentEndOverlap not called

Hi all,

I created a AGhostActor (AActor) in C++ and registered for OnComponentBeginOverlap and OnComponentEndOverlap events:

 CollisionShape->OnComponentBeginOverlap.AddDynamic(this, &AGhostActor::OnBeginOverlap);
 CollisionShape->OnComponentEndOverlap.AddDynamic(this, &AGhostActor::OnEndOverlap);        
 CollisionShape->bGenerateOverlapEvents = true;

I also set "Generate Overlap Events" Flag on an Cube (StaticMesh) in my level (Level was generated by the C++ TopDownExample). The OnComponentBeginOverlap event is calling correctly. But I never got a OnComponeneEndOverlap event. So I checked the source file PrimitiveComponent.cpp. If I'm right, the method UPrimitiveComponent::EndComponentOverlap is responsible for creating the end overlap event for components. There is a check if other actor exists (see if (OtherActor)) and only then the event will be fired. And for my case, where I'm trying to get this event for staticmesh (has no actor as parent) and a actor, I never got the end overlapping event bcuase the staticmesh do not have a actor as parent. For me it looks like a bug. But maybe I'm doing anything false. So maybe someone can help me with my issue.

I also check this https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Components/UPrimitiveComponent/OnComponentEndOverlap/index.html and some other users question and couldn't find a answer.

Thank you in advance

Product Version: UE 4.17
Tags:
more ▼

asked Oct 29 '17 at 04:03 PM in C++ Programming

avatar image

joer.rocket
1 1

avatar image Paul_LTC Jul 16 '18 at 08:13 AM

Bump! I am having an exact same problem. OnComponentEndOverlap isn't called, but OnComponentBeginOverlap is. Check out the question I've asked here: https://answers.unrealengine.com/questions/808709/oncomponentbeginoverlap-works-but-not-oncomponente.html

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

1 answer: sort voted first

Can you try closing the editor when you recompile your project and opening it once your project is finished building? It may be a hot reload issue. The other work around I have used for overlap notifications is to add then in BeginPlay instead of in the constructor.

more ▼

answered Jul 18 '18 at 04:36 PM

Brian Johnstone (suspended)
(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