- Home /
Guard pass throught the walls in Unity Project #1 Stealth!
I'm create a new area and i'm add the walls and doors. I'm add a guard. Play the game and i'm going to the guard. He look at me and chase me. WoW! The guard have a special power - he can pass the walls! Where is problem? On the Stealth area witch rooms and cameras he don't pass the wall, on my - he can ... LOL PLease, help me!!
You need to add coliders. If that doesn't work, I can't help XD
Answer by paintingMist · Sep 30, 2014 at 11:05 PM
I found a slight oversight in the Stealth Tutorial that causes the guard (enemy) to pass right through the doors without opening them. The tutorial has you tag the robotGuard asset with the tag 'Enemy', but you also have to tag the child element called char_robotGuard_body
as 'Enemy' too, so the script will recognize it.
Then DoorAnimation will work with the OnTriggerEnter() statement of 'else if(other.gameObject.tag == Tags.enemy)'. The doors will also open automatically when the guards walk by. Hopefully, your player is not visible inside the room then!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
A node in a childnode? 1 Answer
change to glow texture on mouse click 0 Answers
Newb friendly error x.x conversion float to int 3 Answers
Light flashing through walls help 0 Answers