- Home /
Can't move player's navmesh because the click is on enemy's Sphere Collider (used do set view sight)
Hi!
I'm working on a top down real time strategy.
I add a sphere collider to my enemy to make the sight as unity's stealth project tutorial. But I move my player with mouse click using navmesh, so when I click on sphere collider area, my player doens't move on navmesh, because the click was on sphere collider, no on the floor.
Somebody knows how I can fix it?!
Thanks!
Are you using a raycast from the mouseposition? if so, you can set a layermask in the Raycast call and it will ignore every object with that layer.
Thanks! I put my enemy in Ignore Raycast layer and works! But I think this can be a problem to implements the player shoot...
Yea, you should create a new layer and assign it to the enemy and then use that in your raycast call. Explained here: http://docs.unity3d.com/$$anonymous$$anual/Layers.html
Your answer
Follow this Question
Related Questions
Navmesh Agent Path Not Updating 1 Answer
NavMesh movement and rotation 1 Answer
Can't get player to walk to object using NavMeshAgent 1 Answer
Navmesh works fine at longer distances but bugs out at shorter? 0 Answers
Top-Down Shooter Motion 2 Answers