UE4 c++ OnComponentOverlap and OnComponentHit syntax
13.3 هزار بار بازدید -
9 سال پیش
-
Quick set-up of a basic
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.
9 سال پیش
در تاریخ 1394/12/01 منتشر شده
است.
13,343
بـار بازدید شده