Hello everyone, first off, I hope this is the right section. I am new to the forums.
Basically I am creating a horror game, with jump scares obviously.
Here is an example of this script for a jump scare I have.
```csharp
**using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OneShotMannequin : MonoBehaviour
{
[SerializeField] private Animator Mannequin1;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag(“Player”))
{
Mannequin1.SetBool(“Appear”, true);
}
}
}**
```
So basically, a player walks through a Trigger (box collider) and an animation plays. In this case, the player walks down into a basement, triggers the animation of the mannequin appearing. However, the mannequin is behind the player, so when they player turns around to go back up the stairs, the mannequin will be there.
Is there a way to make sort of a directional one shot jump scare? So if there is a trigger, when the player walks through it nothing happens, but if they turn around and walk through it the other way, it will trigger the jump scare or whatever. Hope this makes sense. Thanks