Astar and UCC TPS, how to?

bbjones

Member
I'm trying to get A * Pathfinding working with UCC TPS agent.

I had a working simple Behaviour Tree for an AI Agent on a unity nav mesh to follow my player character around.

In trying that with A * and either a racast or grid graph, it isn't working and I can't find documentation on how to setup the UCC agent.

For unity navmesh you have to add the Nav Mesh Agent Movement ability to Ucc Locomotion. I tried adding Agent Movement ability on the A * agent and it does move, but only back and forth a bit. Without that ability the agent just stutters in place. It does calculate/update the path to the player, but stays stuck in a small area. It's like the agent is stuck inside an invisible box around 5x5 units in size. And while they are animating properly trying to move, the agent also does not rotate towards the target.

On the UCC agent I manually added RichAI (3D, for navmesh) which included Seeker.

For the BT I just add the A * -> Follow action and link to my player target, same thing I did when using Unity navmesh agent, but then with the non-A* action of course.
 
I was missing that part. I had the integration from the BD side (for each movement pack), not the UCC side, wasn't aware there were 2 integrations to import.

After importing the UCC integration for Astar, I get this compile error:
Code:
Assets\Opsive\UltimateCharacterController\Integrations\Astar Pathfinding Project\AStarAIAgentMovement.cs(108,30): error CS0115: 'AStarAIAgentMovement.SetDestination(Vector3)': no suitable method found to override

In looking at the related code...

IAstarAIMovement is an abstract class, not an interface as the "I" prefix suggests.

The Ucc integration class AStarAIAgentMovement says it uses the IAstarAI interface, but only inherits from PathfindingMovement. It does not implement all members for IAstarAI interface.
Code:
    /// <summary>
    /// Moves the character according to the IAstarAI interface.
    /// </summary>
    public class AStarAIAgentMovement : PathfindingMovement

If I manually change the SetDestination method to not use override then the compile error is resolved and the Astar agent now follows my player character as expected.

Change made in:
Code:
AStarAIAgentMovement -> public override bool SetDestination(Vector3 target)
Changed to:
Code:
public bool SetDestination(Vector3 target)

So, all working for now although with a very simple behaviour tree (one follow task).

Thanks!
 
I tried this solution and it removed the "no suitable override" error but I get errors from Search.cs now.
Code:
Assets\Behavior Designer Movement\Integrations\Astar Pathfinding Project\Tasks\Search.cs(90,52): error CS7036: There is no argument given that corresponds to the required formal parameter 'targetBone' of 'MovementUtility.WithinSight(Transform, Vector3, float, float, GameObject, Vector3, bool, float, out float, int, bool, HumanBodyBones)'
 
The Movement Pack was recently updated and the A* integration goes along with that update - if you update to version 1.5.6 of the Movement Pack you won't get any errors.
 
Top