Hello unreal community!
Im a total beginner and im wondering the following.
I am making a small horror game. Its like a walking simulator style in the woods.
I wanna make an event where if you step inside a trigger you will start to hear footsteps walking behind you. Around 15-20 meters away.
I want them to continue even if you stop. They will only stop if you turn around and look in that direction from where the footsteps are coming from OR when you reach
another triggerbox further ahead and destroy the actor. How would I make something like this?
If you do not know how to code some scenario/problem, split it into smaller tasks/problems:
Your tasks:
you need forest to walk in
you need player character and camera to play with
you want something that follows you and looks where you watch
you want to play sounds
solutions:
To get forest, you browse FAB and get free assets pack, some have decent forests. So you should get map,
to get player charasters, look into startup templates, load one add map from above pack
to get something that follows you. Well this may be complicated.
You can watch tutorial about making enemy bot that follows you. Slow it down or make it stop at some distance like 500 units or 2000. Or you can remember player location every 1 sec or so. Then move from older to newer until you get in that 2000 range.
when you have that entity following player, you can just play sound there.
And hot to detect player is watching stalker. This is easy just line trace from players eyes to stalker, see if trace hit only player and stalker or there is something else between.