Download

Hiding From Enemies

Hi All.

This is incredibly important for my survival-horror game. I need a hiding system, i.e. Lockers, under beds.

If you don’t know what I’m talking about, then look up “Outlast”, you’ll soon get the idea.

Who can help me out? What do I use?

Kai

How I would do it is to create meshes with trigger around them. When the player enters, it tells the GameMode(which controls the game) that the player has been hidden and broadcasts that to all AI in level so they pretend to not see the player.
I don’t know much about animation, but I think it’d be simple.

When setting up NPC’s / Bots / Zombie AI, you typically setup a navmesh or pathing grid in advance.
If the hiding places are located just off the ‘grid’, the AI can never navigate there, so won’t ever reach the player.
Even better is to look into ‘audio sensing’ AI. If the hiding player moves (implicitly makes a sound), then they’re toast!

Hello.

You could add a simple invisible object (like a box) without physics collision as a component into an enemy blueprint, and put the enemy in the center of the invisible object. The size of the invisible object will represent enemy’s detection range. Make sure the invisible object will always generate overlap events when intersected with the protagonist. Create a variable called, for example “Detected”, and set it to true if protagonist is overlapping the invisible object and at the same time isn’t located in a place where he can hide. If “Detected” is true, enemy should perform actions tied to protagonist detection, if “Detected” is false, enemy ignores protagonist.

Hi Again.

Thanks guys, big help!

Kai

One other common technique is to use live tracing from the NPC’s to the Player…
Its a solid approach especially if the map has few but ‘tough’ NPC’s etc…
Its well suited to maps that are large, or tricky to navigate around, and / or have dynamic obstacles etc.
Think about how radar works or Google cars etc, an invisible scanning beam looking around for enemies…
When the player is hidden (enters overlap trigger / stays inside a ‘safe’ vector), tracing is blocked / disabled.

Hi guys I personally don’t know how to do the animation to enter and exit the locker. I want to do it like in outlast where the player gets in the locker and can only look around or get out.

Thanks in advance