其他分享
首页 > 其他分享> > Pickup Objective Actor

Pickup Objective Actor

作者:互联网

在角色的头文件中,添加一个布尔变量,设为共有状态,用来判断是否携带目标物体,并暴露给蓝图,类型为仅蓝图可读

    UPROPERTY(BlueprintReadOnly,Category="Gameplay")
    bool bIsCarryingObjective;

当NotifyActorBeginOverlap发生时,检查是否与FPSCharacter中的角色发生重叠

AFPSCharacter* MyCharacter = Cast<AFPSCharacter>(OtherActor);
    if (MyCharacter)
    {
        MyCharacter->bIsCarryingObjective = true;

        Destroy();
    }

 

标签:Category,AFPSCharacter,角色,蓝图,Actor,Pickup,MyCharacter,Objective,bIsCarryingObjec
来源: https://www.cnblogs.com/suomeimei/p/10350617.html