- Home /
Enemy tries walking through walls.
I am currently making a project using ufps and its enemy ai addon... i have created a building like structure using probuilder. When the player goes near the wall, the enemy start trying to run through the wall to the player... how can I do so that the enemy does not detect the player behind the wall... Thanks.
This is a question of Concept and Game Design. Not really Unity specific.
I didn't get you... i am just asking that how can I get the walls so that the enemy doesn't detect the player behind the wall...
That won't be a built in functionality but a design issue; the concept can work the same in every game engine. Its why I say it's not Unity specific.
Perhaps try using Raycasting.
Answer by McGlovin · May 31, 2014 at 03:06 PM
you could try using a raycast from the enemy, and set it so that the raycast cannot go through through the wall, this way the enemy will only detect the player if the raycast hits the player.
http://unity3d.com/learn/tutorials/modules/beginner/physics/raycasting
:)
Your answer
Follow this Question
Related Questions
Displaying the total number of enemies & updating the number of enemies remaining as they're killed. 1 Answer
(C#) My enemy dosent take damage ScriptFix 1 Answer
Navmesh Agent - stop after player out of range 1 Answer
Help with my Enemy AI script!! 1 Answer
What is the Best way to use Raycast for enemy Fire? 2 Answers