Hi,
Player (Green Circle) is hiding in a room(it's top down view). Cop (Black Circle) is in another room. I have attached a Cop's View(Blue sprite) to the cop as it's child, so it follow as the cop moves in the room. When the player is overlapped with the blue sprite, I want to set that the cop has seen the player.
Question1: Creating a trigger and adding that trigger as a child for cop. is this a good idea?
Question2: BUT the Walls (Red Lines) are in-between, so the cop actually didn't see the player. How can I solve this AI. ?
Thanks a lot in advance
Comments
1) The player is within the boundaries of the blue portion
2) There is no wall collider in between the cop and the player
2) Would require a script that performs a raycast between the two characters. As this is not an AC-related question, you will have to look to Unity's scripting guide or the Unity forum for further help on it, but it's a standard problem when making stealth games and help shouldn't be hard to find.