|
13.创建 Decorator 节点
Unreal Engine 4.9
Previous Step
Next Step
Quick Start Home
Decorators 即为其他行为树系统中的条件语句,附着于一个 Composite
或 Task
节点,并定义树中的一个分支或单个节点是否能被执行。
AI Pawn 接近目标时,Decorator 将停止执行行为树中的 Rapid Move To 分支。利用 Rapid Move To 或 Move To Task 节点也可执行该操作,但 decorator 可接收任何 Actor 并阻止任何分支的执行。在许多情况下均可重复利用。
步骤
在 内容浏览器 中 双击 打开 FollowerBT 行为树。
点击 New Decorator 按钮。
它将创建于和行为树相同的文件夹中。
在 内容浏览器 中将其重命名为 “CloseEnough”。
编辑器应已将其打开以便编辑。如尚未打开,在 内容浏览器 中 双击 打开。
在 My Blueprint 标签下的 Functions 部分中,“覆盖” PerformConditionCheck。
在新功能中创建以下图表:
p').length != 0) { copyToClipboard($('#fullgraphBTService13_snippet > p').html()); } else { copyToClipboard($('#fullgraphBTService13_snippet').html()); }">Copy Example
- Begin Object Class=K2Node_FunctionEntry Name="K2Node_FunctionEntry_232"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2024"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2025"
- End Object
- Begin Object Name="EdGraphPin_2024"
- PinName="then"
- Direction=EGPD_Output
- PinType=(PinCategory="exec")
- LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6389'
- End Object
- Begin Object Name="EdGraphPin_2025"
- PinName="OwnerActor"
- PinToolTip="Owner Actor/nActor Reference"
- Direction=EGPD_Output
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')
- LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6392'
- End Object
- SignatureClass=Class'/Script/AIModule.BTDecorator_BlueprintBase'
- SignatureName="PerformConditionCheck"
- Pins(0)=EdGraphPin'EdGraphPin_2024'
- Pins(1)=EdGraphPin'EdGraphPin_2025'
- NodePosX=-528
- NodePosY=128
- NodeGuid=0A0113274C6A45583FC0029DF5C0B42A
- End Object
- Begin Object Class=K2Node_FunctionResult Name="K2Node_FunctionResult_0"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2018"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2019"
- End Object
- Begin Object Name="EdGraphPin_2018"
- PinName="execute"
- PinType=(PinCategory="exec")
- LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_2031'
- End Object
- Begin Object Name="EdGraphPin_2019"
- PinName="ReturnValue"
- PinToolTip="Return Value/nBoolean"
- PinType=(PinCategory="bool")
- DefaultValue="false"
- AutogeneratedDefaultValue="false"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_39752.EdGraphPin_2117'
- End Object
- SignatureClass=Class'/Script/AIModule.BTDecorator_BlueprintBase'
- SignatureName="PerformConditionCheck"
- Pins(0)=EdGraphPin'EdGraphPin_2018'
- Pins(1)=EdGraphPin'EdGraphPin_2019'
- NodePosX=928
- NodePosY=128
- NodeGuid=DD04EA414F688EBF13F8C4AF7F135206
- End Object
- Begin Object Class=K2Node_DynamicCast Name="K2Node_DynamicCast_1392"
- Begin Object Class=EdGraphPin Name="EdGraphPin_6389"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_6390"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_6391"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_6392"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_6393"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_6394"
- End Object
- Begin Object Name="EdGraphPin_6389"
- PinName="execute"
- PinType=(PinCategory="exec")
- LinkedTo(0)=EdGraphPin'K2Node_FunctionEntry_232.EdGraphPin_2024'
- End Object
- Begin Object Name="EdGraphPin_6390"
- PinName="then"
- Direction=EGPD_Output
- PinType=(PinCategory="exec")
- LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_2030'
- End Object
- Begin Object Name="EdGraphPin_6391"
- PinName="CastFailed"
- Direction=EGPD_Output
- PinType=(PinCategory="exec")
- End Object
- Begin Object Name="EdGraphPin_6392"
- PinName="Object"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/CoreUObject.Object')
- LinkedTo(0)=EdGraphPin'K2Node_FunctionEntry_232.EdGraphPin_2025'
- End Object
- Begin Object Name="EdGraphPin_6393"
- PinName="AsFollower AI CON"
- Direction=EGPD_Output
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
- LinkedTo(0)=EdGraphPin'K2Node_VariableSet_421.EdGraphPin_2032'
- End Object
- Begin Object Name="EdGraphPin_6394"
- PinName="bSuccess"
- Direction=EGPD_Output
- PinType=(PinCategory="bool")
- bHidden=True
- End Object
- TargetType=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C'
- Pins(0)=EdGraphPin'EdGraphPin_6389'
- Pins(1)=EdGraphPin'EdGraphPin_6390'
- Pins(2)=EdGraphPin'EdGraphPin_6391'
- Pins(3)=EdGraphPin'EdGraphPin_6392'
- Pins(4)=EdGraphPin'EdGraphPin_6393'
- Pins(5)=EdGraphPin'EdGraphPin_6394'
- NodePosX=-192
- NodePosY=144
- NodeGuid=735B1F0141DBFBCA06C2CEB84A6936B4
- End Object
- Begin Object Class=K2Node_VariableSet Name="K2Node_VariableSet_421"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2030"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2031"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2032"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2033"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2034"
- End Object
- Begin Object Name="EdGraphPin_2030"
- PinName="execute"
- PinType=(PinCategory="exec")
- LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6390'
- End Object
- Begin Object Name="EdGraphPin_2031"
- PinName="then"
- Direction=EGPD_Output
- PinType=(PinCategory="exec")
- LinkedTo(0)=EdGraphPin'K2Node_FunctionResult_0.EdGraphPin_2018'
- End Object
- Begin Object Name="EdGraphPin_2032"
- PinName="AI_CON_Ref"
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
- LinkedTo(0)=EdGraphPin'K2Node_DynamicCast_1392.EdGraphPin_6393'
- End Object
- Begin Object Name="EdGraphPin_2033"
- PinName="Output_Get"
- PinToolTip="Retrieves the value of the variable, can use instead of a separate Get node"
- Direction=EGPD_Output
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
- End Object
- Begin Object Name="EdGraphPin_2034"
- PinName="self"
- PinFriendlyName="Target"
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')
- bHidden=True
- End Object
- VariableReference=(MemberName="AI_CON_Ref",bSelfContext=True)
- Pins(0)=EdGraphPin'EdGraphPin_2030'
- Pins(1)=EdGraphPin'EdGraphPin_2031'
- Pins(2)=EdGraphPin'EdGraphPin_2032'
- Pins(3)=EdGraphPin'EdGraphPin_2033'
- Pins(4)=EdGraphPin'EdGraphPin_2034'
- NodePosX=80
- NodePosY=144
- NodeGuid=38C59DC54CFF01BBAA134EA5044A5015
- End Object
- Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_123506"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2045"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2046"
- End Object
- Begin Object Name="EdGraphPin_2045"
- PinName="self"
- PinFriendlyName="Target"
- PinToolTip="Target/nController Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Controller')
- LinkedTo(0)=EdGraphPin'K2Node_VariableGet_624.EdGraphPin_2051'
- End Object
- Begin Object Name="EdGraphPin_2046"
- PinName="ReturnValue"
- PinToolTip="Return Value/nPawn Reference"
- Direction=EGPD_Output
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Pawn')
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30834.EdGraphPin_2057'
- End Object
- bIsPureFunc=True
- bIsConstFunc=True
- FunctionReference=(MemberParentClass=Class'/Script/Engine.Controller',MemberName="K2_GetPawn")
- Pins(0)=EdGraphPin'EdGraphPin_2045'
- Pins(1)=EdGraphPin'EdGraphPin_2046'
- NodePosX=-240
- NodePosY=384
- NodeGuid=431AF3184AEF62590716B7AFBC166188
- End Object
- Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_624"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2051"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2052"
- End Object
- Begin Object Name="EdGraphPin_2051"
- PinName="AI_CON_Ref"
- Direction=EGPD_Output
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/Follower_AI_Con.Follower_AI_CON_C')
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_123506.EdGraphPin_2045'
- End Object
- Begin Object Name="EdGraphPin_2052"
- PinName="self"
- PinFriendlyName="Target"
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')
- bHidden=True
- End Object
- VariableReference=(MemberName="AI_CON_Ref",bSelfContext=True)
- Pins(0)=EdGraphPin'EdGraphPin_2051'
- Pins(1)=EdGraphPin'EdGraphPin_2052'
- NodePosX=-416
- NodePosY=384
- NodeGuid=D0D08EBC43D0D16966A4379430CA4038
- End Object
- Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_30834"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2057"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2058"
- End Object
- Begin Object Name="EdGraphPin_2057"
- PinName="self"
- PinFriendlyName="Target"
- PinToolTip="Target/nActor Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_123506.EdGraphPin_2046'
- End Object
- Begin Object Name="EdGraphPin_2058"
- PinName="ReturnValue"
- PinToolTip="Return Value/nVector "
- Direction=EGPD_Output
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
- DefaultValue="0, 0, 0"
- AutogeneratedDefaultValue="0, 0, 0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31029.EdGraphPin_2089'
- End Object
- bIsPureFunc=True
- bIsConstFunc=True
- FunctionReference=(MemberParentClass=Class'/Script/Engine.Actor',MemberName="K2_GetActorLocation")
- Pins(0)=EdGraphPin'EdGraphPin_2057'
- Pins(1)=EdGraphPin'EdGraphPin_2058'
- NodePosX=16
- NodePosY=384
- NodeGuid=07C3199047638F25D389BCB6D5AA4B65
- End Object
- Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_30917"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2081"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2082"
- End Object
- Begin Object Name="EdGraphPin_2081"
- PinName="self"
- PinFriendlyName="Target"
- PinToolTip="Target/nActor Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_26123.EdGraphPin_2129'
- End Object
- Begin Object Name="EdGraphPin_2082"
- PinName="ReturnValue"
- PinToolTip="Return Value/nVector "
- Direction=EGPD_Output
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
- DefaultValue="0, 0, 0"
- AutogeneratedDefaultValue="0, 0, 0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31029.EdGraphPin_2088'
- End Object
- bIsPureFunc=True
- bIsConstFunc=True
- FunctionReference=(MemberParentClass=Class'/Script/Engine.Actor',MemberName="K2_GetActorLocation")
- Pins(0)=EdGraphPin'EdGraphPin_2081'
- Pins(1)=EdGraphPin'EdGraphPin_2082'
- NodePosX=16
- NodePosY=288
- NodeGuid=895F88654C27F0C5BCA2E2A8F868C28C
- End Object
- Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_31029"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2087"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2088"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2089"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2090"
- End Object
- Begin Object Name="EdGraphPin_2087"
- PinName="self"
- PinFriendlyName="Target"
- PinToolTip="Target/nKismet Math Library Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
- DefaultObject=Default__KismetMathLibrary
- bHidden=True
- End Object
- Begin Object Name="EdGraphPin_2088"
- PinName="A"
- PinToolTip="A/nVector "
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
- DefaultValue="0, 0, 0"
- AutogeneratedDefaultValue="0, 0, 0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30917.EdGraphPin_2082'
- End Object
- Begin Object Name="EdGraphPin_2089"
- PinName="B"
- PinToolTip="B/nVector "
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
- DefaultValue="0, 0, 0"
- AutogeneratedDefaultValue="0, 0, 0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30834.EdGraphPin_2058'
- End Object
- Begin Object Name="EdGraphPin_2090"
- PinName="ReturnValue"
- PinToolTip="Return Value/nVector "
- Direction=EGPD_Output
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
- DefaultValue="0, 0, 0"
- AutogeneratedDefaultValue="0, 0, 0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31141.EdGraphPin_2100'
- End Object
- bIsPureFunc=True
- FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="Subtract_VectorVector")
- Pins(0)=EdGraphPin'EdGraphPin_2087'
- Pins(1)=EdGraphPin'EdGraphPin_2088'
- Pins(2)=EdGraphPin'EdGraphPin_2089'
- Pins(3)=EdGraphPin'EdGraphPin_2090'
- NodePosX=240
- NodePosY=352
- NodeGuid=5A8D334A4D575676CD7D149EB17AFD8B
- End Object
- Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_31141"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2099"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2100"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2101"
- End Object
- Begin Object Name="EdGraphPin_2099"
- PinName="self"
- PinFriendlyName="Target"
- PinToolTip="Target/nKismet Math Library Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
- DefaultObject=Default__KismetMathLibrary
- bHidden=True
- End Object
- Begin Object Name="EdGraphPin_2100"
- PinName="A"
- PinToolTip="A/nVector "
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Vector')
- DefaultValue="0, 0, 0"
- AutogeneratedDefaultValue="0, 0, 0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31029.EdGraphPin_2090'
- End Object
- Begin Object Name="EdGraphPin_2101"
- PinName="ReturnValue"
- PinToolTip="Return Value/nFloat"
- Direction=EGPD_Output
- PinType=(PinCategory="float")
- DefaultValue="0.0"
- AutogeneratedDefaultValue="0.0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_39752.EdGraphPin_2115'
- End Object
- bIsPureFunc=True
- FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="VSize")
- Pins(0)=EdGraphPin'EdGraphPin_2099'
- Pins(1)=EdGraphPin'EdGraphPin_2100'
- Pins(2)=EdGraphPin'EdGraphPin_2101'
- NodePosX=352
- NodePosY=352
- NodeGuid=82F21A114631FECA2AE22AA74D0DF02D
- End Object
- Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_151"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2108"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2109"
- End Object
- Begin Object Name="EdGraphPin_2108"
- PinName="AcceptableDistance"
- Direction=EGPD_Output
- PinType=(PinCategory="float")
- DefaultValue="0.0"
- AutogeneratedDefaultValue="0.0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_39752.EdGraphPin_2116'
- End Object
- Begin Object Name="EdGraphPin_2109"
- PinName="self"
- PinFriendlyName="Target"
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')
- bHidden=True
- End Object
- VariableReference=(MemberName="AcceptableDistance",bSelfContext=True)
- Pins(0)=EdGraphPin'EdGraphPin_2108'
- Pins(1)=EdGraphPin'EdGraphPin_2109'
- NodePosX=368
- NodePosY=432
- NodeGuid=7CDE1FD54D772AEF57C5F693ED511A8E
- End Object
- Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_39752"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2114"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2115"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2116"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2117"
- End Object
- Begin Object Name="EdGraphPin_2114"
- PinName="self"
- PinFriendlyName="Target"
- PinToolTip="Target/nKismet Math Library Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
- DefaultObject=Default__KismetMathLibrary
- bHidden=True
- End Object
- Begin Object Name="EdGraphPin_2115"
- PinName="A"
- PinToolTip="A/nFloat"
- PinType=(PinCategory="float")
- DefaultValue="0.0"
- AutogeneratedDefaultValue="0.0"
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_31141.EdGraphPin_2101'
- End Object
- Begin Object Name="EdGraphPin_2116"
- PinName="B"
- PinToolTip="B/nFloat"
- PinType=(PinCategory="float")
- DefaultValue="0.0"
- AutogeneratedDefaultValue="0.0"
- LinkedTo(0)=EdGraphPin'K2Node_VariableGet_151.EdGraphPin_2108'
- End Object
- Begin Object Name="EdGraphPin_2117"
- PinName="ReturnValue"
- PinToolTip="Return Value/nBoolean"
- Direction=EGPD_Output
- PinType=(PinCategory="bool")
- DefaultValue="false"
- AutogeneratedDefaultValue="false"
- LinkedTo(0)=EdGraphPin'K2Node_FunctionResult_0.EdGraphPin_2019'
- End Object
- bIsPureFunc=True
- FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="GreaterEqual_FloatFloat")
- Pins(0)=EdGraphPin'EdGraphPin_2114'
- Pins(1)=EdGraphPin'EdGraphPin_2115'
- Pins(2)=EdGraphPin'EdGraphPin_2116'
- Pins(3)=EdGraphPin'EdGraphPin_2117'
- NodePosX=544
- NodePosY=384
- NodeGuid=D75D724E47942AC9F4D77F987B81AD57
- End Object
- Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_26123"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2126"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2127"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2128"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2129"
- End Object
- Begin Object Name="EdGraphPin_2126"
- PinName="self"
- PinFriendlyName="Target"
- PinToolTip="Target/nBTFunction Library Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/AIModule.BTFunctionLibrary')
- DefaultObject=Default__BTFunctionLibrary
- bHidden=True
- End Object
- Begin Object Name="EdGraphPin_2127"
- PinName="NodeOwner"
- PinToolTip="Node Owner/nBTNode Reference"
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/AIModule.BTNode')
- bHidden=True
- End Object
- Begin Object Name="EdGraphPin_2128"
- PinName="Key"
- PinToolTip="Key/nBlackboard Key Selector Structure (by ref)"
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/AIModule.BehaviorTreeTypes:BlackboardKeySelector',bIsReference=True,bIsConst=True)
- LinkedTo(0)=EdGraphPin'K2Node_VariableGet_111.EdGraphPin_2138'
- bDefaultValueIsIgnored=True
- End Object
- Begin Object Name="EdGraphPin_2129"
- PinName="ReturnValue"
- PinToolTip="Return Value/nActor Reference"
- Direction=EGPD_Output
- PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.Actor')
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_30917.EdGraphPin_2081'
- End Object
- bIsPureFunc=True
- FunctionReference=(MemberParentClass=Class'/Script/AIModule.BTFunctionLibrary',MemberName="GetBlackboardValueAsActor")
- Pins(0)=EdGraphPin'EdGraphPin_2126'
- Pins(1)=EdGraphPin'EdGraphPin_2127'
- Pins(2)=EdGraphPin'EdGraphPin_2128'
- Pins(3)=EdGraphPin'EdGraphPin_2129'
- NodePosX=-256
- NodePosY=288
- ErrorType=1
- ErrorMsg="Error Default value /'/' for Key is invalid: /'Literal values are not allowed for pass-by-reference parameters./'"
- NodeGuid=FF6A2DB4475BFE05D0CA1EB0D698BB0A
- End Object
- Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_111"
- Begin Object Class=EdGraphPin Name="EdGraphPin_2138"
- End Object
- Begin Object Class=EdGraphPin Name="EdGraphPin_2139"
- End Object
- Begin Object Name="EdGraphPin_2138"
- PinName="TargetToFollow"
- Direction=EGPD_Output
- PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/AIModule.BehaviorTreeTypes:BlackboardKeySelector')
- LinkedTo(0)=EdGraphPin'K2Node_CallFunction_26123.EdGraphPin_2128'
- End Object
- Begin Object Name="EdGraphPin_2139"
- PinName="self"
- PinFriendlyName="Target"
- PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/AI/CloseEnough.CloseEnough_C')
- bHidden=True
- End Object
- VariableReference=(MemberName="TargetToFollow",bSelfContext=True)
- Pins(0)=EdGraphPin'EdGraphPin_2138'
- Pins(1)=EdGraphPin'EdGraphPin_2139'
- NodePosX=-416
- NodePosY=288
- NodeGuid=7E75B438413B960D40E5A68DECD346A2
- End Object
复制代码
p').length != 0) { copyToClipboard($('#fullgraphBTService13_snippet > p').html()); } else { copyToClipboard($('#fullgraphBTService13_snippet').html()); }">
点击图片将其展开,或点击 此处
在窗口中打开。
该蓝图的变量名、类型和数值:
AI_CON_Ref
Follower_AI_CON_C
无
AcceptableDistance
Float
0.0 - 但此变量的“可编辑”标记为 True,因此可在行为树中根据实例进行变更。
TargetToFollow
BlackboardKeySelector
无 - 但此变量的“可编辑”标记为 True,因此可在行为树中根据实例进行变更。
因其为功能图表,如使用上方图表图片中的 Code Snippet,只能获取图表的中央部分,首尾两端的节点将不会被连接。只需依据图片所示连接节点便可正常执行。
当行为树根据条件命中一个节点时,事件 Receive Condition Check 将被发送至该蓝图。
保存 AI 控制器以便日后轻松参考。
获取需要追踪的 Actor(玩家 Pawn)。
获取该 Actor 和 AI Pawn 之间的距离。
如距离大于可配置量,则条件将返回 True。如小于可配置量,则返回 False,并阻止其所在行为树部分的执行。
这可使其正常工作,避免行为树不断循环至 RapidMoveTo,导致 AI 反复行动。基本上而言,AI 抓住玩家后便会停止行动。
Previous Step
Next Step
Quick Start Home
完整内容索引
2004-2017, Epic Games, Inc. 版权所有。Unreal 及相关的商标是 Epic 在美国和其他国家的注册商标。
使用条款 | 隐私政策
|
|