Hi everyone,
I’m curious on how to properly create an NPC with Hitboxes driven by an RVOController?
It seems as if the NPC-Movement is slowing down exremely (almost coming to a halt), when there is a collider between the 2 Yellow Spherical Gizmos created by the RVOController. I’m also masking the Colliders out in the RVOController’s settings, so that cant be the issue.
I checked the scripts and could only find one Physics.Raycast, and this one is only needed to place the character on the ground. Yet, when i set the Hitboxes to “Trigger”, and Disable “Queries Hit Triggers” in the Physics menu, everything works fine.
Any hint into the right direction would be highly appreciated, as i unfortunatly can’t avoid using hitboxes/colliders that are detected via raycasts on my NPCs.
Cheers and Thanks,
Alex
Hi
Are you sure those colliders are not being detected by the pathfinding graph then?
Hmm what exactly do you mean by “detected by the pathfinding graph”?
The NPC Partols like that:
-) Get next target position
-) Calculate and store path to this position (Collider Independent - Only using a recast graph atm)
-) Move NPC via RVOController.Move() from Point to Point on the generated Path, until the NPC is close enough and generates a new path from there on.
Am i misunderstanding something? I thought that the calculated path shouldnt have to do anything with the RVOController?
Hi
Correct, and the rvo controller should not be affected by colliders at all except for checking where the ground is. So I was wondering if your graph (recast graph in this case) was affected by the colliders and that was the problem.
Hmm i guess that cant be the issue. The graph looks fine, and actually the recast-graph is pre-cached (with any colliders that could do harm disabled). Also this should only influence the pathfinding itself, not the RVOController movement as far as i understand?
When i disable the Collider in runtime, everything works fine. When i enable it, the NPC becomes terribly slow again. Also, i’m not updating the recast-graph in runtime.
Thanks for the fast response
Ok. I am not sure what would be the cause then. What script are you using that calls Move on the RVOController? Is that affected by the collider?
pfffff…
sorry for wasting your time on this one! you totally pointed me into the right direction… i was using a raycast in my direction-calculation (initially, before i had RVO implemented) to determine the height… now the velocity would return weird values because of interfering colliders!
thanks for pointing me into the right direction! awesome product! 5 stars!
cheers and thanks!
Great that you managed to figure out what was causing it
Thank you for the stars as well. Rating the package on the Asset Store and/or writing a review is always appreciated.