- Home /
how do i detect if a game object is visible to another game object
I big dumb and dont know how unity work so i am just trying to make a game object move towards another game object. Im trying to make it so it doesnt move towards the other game object when the other game object is hiding behind something. Im also trying to create an area that the original game object can see in, so it can see things behind it as well. How do thing?
Answer by DaoGear · Mar 06 at 06:39 AM
This helped alot after i converted the tutorial to 2d and i got an output when the player goes in a radius i set. Although the raycast i created doesnt get blocked by walls meaning you cant hide behind things. I set the ground and walls in one layer which is supposed to block the raycast, it doesnt heres the code i made (dave is the player because random name = funny)
Your answer

Follow this Question
Related Questions
Enemy Combat AI 1 Answer
Kill character on impact 1 Answer
Enemy Jump AI Problem 0 Answers
Add navmesh to enemy 0 Answers