Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
913 B
0
Indexable
Never
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!");
        }
    }
}
Leave a Comment