You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to build a character controller script using NPBehave.
I have a blackboard with a key called "isMovePressed" that turns true or false depending on player input.
So i used the BlackboardCondition to set the animator key to true of false if the "isMovePressed" value is updated.
The problem is that the Parallel node only keeps executing its children if a SUCCESS or FAILED status is returned by the children,
if i return PROGRESS the other actions will keep waiting and the rest of the tree will not work.
But if i return SUCCESS or FAILED the action DoStop() will never be called on the BlackboardCondition class and is not possible to set the animator "isWalking" boolean back to false when the condition fails.
So based on this i believe it is not possible to handle player input on this library, because the tree cannot wait for some action while execute other in parallel.
My question is if this is right or do i miss something?
return new Root(
blackboard,
new Parallel(
Parallel.Policy.ALL,
Parallel.Policy.ALL,
new BlackboardCondition(
"isMovePressed",
Operator.IS_EQUAL,
true,
Stops.SELF,
new Action(
(abort) =>
{
if (abort)
{
animator.SetBool("isWalking", false);
return Action.Result.SUCCESS;
}
animator.SetBool("isWalking", true);
return Action.Result.PROGRESS;
}
)
),
new Action(() => Debug.Log("ONLY RUN WHEN THE FIRST RETURN SUCCESS OR FAILURE;"))
)
);
The text was updated successfully, but these errors were encountered:
I was trying to build a character controller script using NPBehave.
I have a blackboard with a key called "isMovePressed" that turns true or false depending on player input.
So i used the BlackboardCondition to set the animator key to true of false if the "isMovePressed" value is updated.
The problem is that the Parallel node only keeps executing its children if a SUCCESS or FAILED status is returned by the children,
if i return PROGRESS the other actions will keep waiting and the rest of the tree will not work.
But if i return SUCCESS or FAILED the action DoStop() will never be called on the BlackboardCondition class and is not possible to set the animator "isWalking" boolean back to false when the condition fails.
So based on this i believe it is not possible to handle player input on this library, because the tree cannot wait for some action while execute other in parallel.
My question is if this is right or do i miss something?
The text was updated successfully, but these errors were encountered: