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.