Binding a function in code to OnComponentBeginOverlap, OnComponentEndOverlap, or OnComponentHit does not trigger the bound function from code.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) USphereComponent* SphereComp; UFUNCTION(BlueprintCallable, Category = Test) void SphereFunc(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
#include "Engine.h"
SphereComp = CreateDefaultSubobject<USphereComponent>(TEXT("SphereComp")); SphereComp->OnComponentBeginOverlap.AddDynamic(this, &AMyActor::SphereFunc);
void AMyActor::SphereFunc(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) { if (GEngine) { GEngine->AddOnScreenDebugMessage(-1, 4.f, FColor::Red, TEXT("Overlap")); } }
Result:
Bound SphereFunc doesn't print Overlap message
Expected:
When OnComponentOverlap triggers, function bound in code triggers as well.
Repro Rate:
3/3
i have this problem UE4CC-Windows-58DC12AF4B97F057BD108FBFF569B2E9_0000
I am not able to find world outliner how to enable it?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
Delay nodes occasionally don't fire the "Completed" output in a nativized build
How can i modify the param name in EQS node
How to achieve HLSL Multiple Render Target in Material blueprints?
Head over to the existing Questions & Answers thread and let us know what's up.
2 |
Component | UE - Gameplay - Components |
---|---|
Affects Versions | 4.11.2 |
Target Fix | 4.12 |
Created | Apr 25, 2016 |
---|---|
Resolved | Apr 25, 2016 |
Updated | Apr 27, 2018 |