Question by
Aprimez · Jul 01, 2017 at 06:25 PM ·
raycastnavmeshagentraycasting
Raycasting onto a Nav Mesh Agent
I've made a kinda FPS game where the gun used uses raycast to register what has be hit.
Unfortunately, the Nav Mesh Agent is about the only thing - as far as I'm aware - that doesn't get picked up.
My code is the following:
RaycastHit hit;
if (Physics.Raycast (fpsCam.transform.position, fpsCam.transform.forward, out hit, range, 9))
{
Debug.Log(hit.transform.name);
}
Everything logs, boxes, walls, terrain, but not the nav mesh agent. Ideally, I wouldn't have to add a block on top of him as then my flairs will be flat and also, when the nav mesh agent moves his arms it wouldn't line up properly.
There must be a way surely?
Comment