- Home /
Raycasting wont work when my Nev Mesh Agent asks on it's own in the background
I've been working on my game's enemies for a while now and they work fine at some degree however when my navmesh agent/Enemy is moving on it's own in the background and when I finally meet and shoot it, the raycast is shooting behind him. The colliders work in the background and they stayed in place when I looked on the scene view. It's just a matter of my Raycast seem to not able to detect the Enemy when the AI moves independently in the background. But when it stays in place when I finally meet them, The raycast works.
Please provide more information as there can be 100s of solutions to whatever your problem could be.
After building and play testing it to other PCs it seems that my enemies move randomly because of it's high framerate. When the game is hitting 60+ fps, the enemies become a bit volatile and they dont get hit by my raycasts. On lower end PCs this is not an issue when the frame rate goes down less than 30fps.