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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

C++ OnComponentEndOverlap Not Working

Begin overlap is working fine, but I can't get end overlap to trigger.

.h file:

 UPROPERTY(VisibleAnywhere, Category = "Default")
 UBoxComponent* BoxCollision = nullptr;
 
 UFUNCTION()
 void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult);
     
 UFUNCTION()
 void OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);

.cpp file - constructor

    BoxCollision->bGenerateOverlapEvents = true;
     BoxCollision->OnComponentBeginOverlap.AddDynamic(this, &ADisplacementTankSlot::OnOverlapBegin);
     BoxCollision->OnComponentEndOverlap.AddDynamic(this, &ADisplacementTankSlot::OnOverlapEnd);

.cpp functions

 void ADisplacementTankSlot::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
 {
     UE_LOG(LogTemp, Warning, TEXT("OVERLAP BEGIN"));
 }
 
 void ADisplacementTankSlot::OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
 {
     UE_LOG(LogTemp, Warning, TEXT("OVERLAP END"));
 }


Product Version: UE 4.15
Tags:
more ▼

asked May 04 '17 at 07:23 PM in C++ Programming

avatar image

DFILL450
23 7 12 15

avatar image DFILL450 May 04 '17 at 08:01 PM

So this post here suggests that it doesn't work because it's a bug with the engine: https://answers.unrealengine.com/questions/419154/component-end-overlap-not-working-c.html

I tried using OnActorEndOverlap instead, and that indeed does work. So is this still a bug with the engine? How has this not been fixed?

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

1 answer: sort voted first

That bug UE-29879 is marked as Cannot Reproduce and is closed.

If you have a project / steps to reproduce the issue, I encourage you to post in the Bug Reports section with as much detail as possible. How to write a bug.

more ▼

answered May 05 '17 at 02:28 PM

avatar image

ImVawx ♦♦ STAFF
6.8k 114 17 127

(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