Untitled
unknown
plain_text
2 years ago
913 B
5
Indexable
using UnityEngine;
public class HorrorHouseController : MonoBehaviour
{
private bool isInsideHouse = false;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
isInsideHouse = true;
Debug.Log("You entered the horror house!");
// Add horror effects or events here
}
}
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
isInsideHouse = false;
Debug.Log("You left the horror house.");
// Reset horror effects or events here
}
}
private void Update()
{
if (isInsideHouse && Input.GetKeyDown(KeyCode.E))
{
// Implement interaction inside the horror house (e.g., jump scare, trigger events)
Debug.Log("You interacted inside the horror house!");
}
}
}
Editor is loading...
Leave a Comment