Terrain, A* game object, Behaviour Designer with movement + A* addition
“Mob” -> Capsule with simple behavior to see an object, and seek it when found
Path Failed : Computation Time 0,00 ms Searched Nodes 0
Error: Couldn't find a node close to the end point
Path Number 8761 (unique id)
AstarPath:LogPathResults(Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:835)
AstarPath:<InitializePathProcessor>b__122_1(Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1297)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler) (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:389)
Pathfinding.<>c__DisplayClass24_0:<.ctor>b__0() (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:110)
Thanks for the link, however that does not seem to apply in my case (as far as my limited knowledge can attest),
The scenario is that the capsule (mob) is standing on top of a tiny little slope, and i have my character below the mob (down the slope, as it were), but no matter where i stand the capsule spams the same error message, it’s standing on the blue stuff (the generated navmesh?) and i’m also standing on it with the player. neither of us are particularily far from the blue stuff as our feet (or bottom of cylinder) are touching it.
Another note, sometimes, if i move the capsule and then disable and re-enable it, it will spin an arbitrary ammount of times (within the triangle it stands in) trying to get to “me”, sometimes it just gives up and stops, sometimes it spins like a fidgetspinner forever. And now a third option appeared, if i try to move the capsule (mob) back a bit in the editor (still playing btw) then it will walk back to the place more or less where he got stuck the last time, persistant to stay there i can bob him back and he walks forward, like a persistant little mouse
Here they are, i would have sent one where the capsule is “looking” at the player but the moment it sees it right now, it runs a circle inside that triangle it stands in, then gets stuck where it is now, spamming the aforementioned error.
Could you try removing Behaviour Designer for a moment and just attaching the AIDestinationSetter component to the same GameObject as the AIPath script.
Also. The “Height” field on the agent is very tiny. This doesn’t have any affect on pathfinding, but the Behaviour Designer might use it indirectly. It is best if it is set to a reasonable value.
For navmesh graph movement I also recommend that you attach the FunnelModifier script to the agents (see https://arongranberg.com/astar/docs/modifiers.php). Also I think you have set Seeker -> Start End Modifier -> Add Points to true. That is not useful for your use case so I would recommend turning it off to revert it to the default value.
Also. Make sure that the recast graph’s layer mask does not include the layer that the agents are in (seems to be the Default layer in this case).
Allright, moved the capsule + player to different layers that are not in the layer mask inclusions, check
Unchecked the addpoints thing, check.
Changed the height of the mob to match aproximate height of capsule, check.
Thanks a bunch for all the help, the narrowing down really helped!
The solution was that even with the simplest behavior tree which was like so:
There was still stuff that wasn’t clear, such as the need to actually BIND the “Can See Object”'s “Returned Object” variable to a variable you’ve created of type gameobject in the Variables tab, and then use that variable (in this case, i named it Target), inside the “Seek” task and bind it to the internal “Target” variable, a bit messy and confusing for a beginner, but once that’s set then all works
Thanks again for the help aron! probably would have been stuck for several days more on this if it wasn’t for your kind assistance in the problemsolving department!