Back to Browse

UE4 c++ OnComponentOverlap and OnComponentHit syntax

13.5K views
Feb 21, 2016
10:22

Quick set-up of a basic actor in c++, including the on component overlap event. Overlap declaration: UFUNCTION() void MyOverlapFunction(AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult); Hit Declaration: UFUNCTION() void MyHitFunction(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit) How to bind overlap: MyPrimitiveComponent(Point)OnComponentBeginOverlap.AddDynamic(this, &AMyActor::MyFunction); How to bind hit: MyPrimitiveComponent(Point)OnComponentHit.AddDynamic(this, &AMyActor::MyFunction); Note using (Point) as it won't allow greater than or less than signs in description.

Download

1 formats

Video Formats

360pmp415.3 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

UE4 c++ OnComponentOverlap and OnComponentHit syntax | NatokHD