当有物体与这个component相接触的时候,就会回调这个函数。 AreaSphere->OnComponentBeginOverlap.AddDynamic(this, &AWeapon::OnSphereOverlap); 函数定义: UFUNCTION() virtual void OnSphereOverlap( UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex...
UE5相机系统初探2-10 然后,我们再新写一个Actor类,用于控制这两个相机之间的切换,比如这里我们创建一个矩形区域,玩家如果进入该区域,就需要切换到Camera Actor,离开区域则切换回原有的相机。 voidACF_ViewTargetActor::OnOverlapBegin(UPrimitiveComponent*OverlappedComp,AActor*OtherActor,UPrimitiveComponent*OtherComp...
An ordered list of components that the MovedComponent overlapped during its movement (eg. generated during a sweep). Only used to add potentially new overlaps. Might not be overlapping them now. 移动组件在移动过程中重叠的有序组件列表(例如:在扫描过程中生成)。仅用于添加潜在的新重叠。 说人话就是...
virtual void OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult); UFUNCTION() virtual void EndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent*...
virtual void OnBoxOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult); //配置当前的生成体积所需生成的敌人 UPROPERTY(EditAnywhere) ...
我们通过调用OnComponentBeginOverlap和OnComponentEndOverlap将胶囊连接到重叠事件。 ...voidAUnrealCPPCharacter::OnOverlapBegin(classUPrimitiveComponent*OverlappedComp,classAActor*OtherActor,classUPrimitiveComponent*OtherComp,int32 OtherBodyIndex,boolbFromSweep,constFHitResult&SweepResult){if(OtherActor&&(OtherActor...
//.h文件UFUNCTION()//一定要加voidOnComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent,AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,boolbFromSweep,constFHitResult & SweepResult);//.cppvoidAHospitalActor::OnComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent,...
LightSphere->SetupAttachment(RootComponent); } // Called when the game starts or when spawned void ALightSwitchPushButton::BeginPlay() { Super::BeginPlay(); } void ALightSwitchPushButton::ToggleLight() { PointLight->ToggleVisibility();
// declare overlap begin functionUFUNCTION()voidOnOverlapBegin(classUPrimitiveComponent*OverlappedComp,classAActor*OtherActor,classUPrimitiveComponent*OtherComp,int32 OtherBodyIndex,boolbFromSweep,constFHitResult&SweepResult);// declare overlap end functionUFUNCTION()voidOnOverlapEnd(classUPrimitiveComponent*Ove...
voidASurMagicProjectile::OnActorOverlap(UPrimitiveComponent*OverlappedComponent,AActor*OtherActor,U...