Start Ability not doing anything

Haytam95

Active member
Hi

I'm starting to design the AI and i'm having a hard time with a simple task: Start an Ability (Speed Change). I need that the agent start running when he is far away from the character, while he seeks him.

1590372890589.png

Here is my tree, some details about it:

- Repeater is forever.

- Paralel because i want the character the agent to Seek the player, regardless if he is running or not. (I didn't added the part when he should stop running, yet so when the character is near by the player also the seek stops working).

- Within distance has the target object of the player and a magnitude of "5". The inverter is to check that he isn't in that range.

- Start Stop Ability just is pointed to Speed Change; start checked and always return success.

The distance checker is working fine:

1590373205066.png


By doing a little debugging, a discovered that the Start Stop Ability is only called on the start frame, in which fails because the character is not moving. Then, Behavior isn't trying to Start the ability again.

What should i do?

Thanks!
 
You could try placing a repeater above the sequence task which will allow it to retry again even if it succeeded. Parallel tasks do not rerun a child branch that has returned success so that's why it only tried it on the first frame.
 
The Speed parameter does look like it's changing since it is normally 0 and is the value specified by the Speed Parameter on the ability.

The Forward Movement value should be larger though. Within the Speed Change ability is it updating the Input Vector correctly?
 
Thanks - that points me to what I think the issue is. Try placing the Speed Change ability below the NavMesh Movement ability. The NavMesh Movement ability is responsible for setting the input vector and if the Speed Change ability is first then it doesn't get a chance to receive the pathfinding input.
 
Thanks Justin, that did it!

So i'm thinking, NavMesh should be the first ability in the list, in order to get correctly the movement parameters? Or maybe third bellow fall & jump?
 
Top