Continued working on the lights, set up playable version and turn trap at the end of the stairs. Working on making stairs feel longer.

This commit is contained in:
2025-12-03 17:23:18 +00:00
parent 732a2577c2
commit e0c93be280
67 changed files with 29354 additions and 534 deletions

View File

@@ -0,0 +1,45 @@
using UnityEngine;
public class StaircaseDistortion : MonoBehaviour
{
[Header("The Vertigo Effect")]
public float normalFOV = 60f;
public float stretchedFOV = 110f; // High FOV makes things look far away
public float transitionSpeed = 0.5f;
private Camera playerCam;
private bool isOnStairs = false;
void Update()
{
if (playerCam == null) return;
if (isOnStairs)
{
// Slowly widen the view (Stretch)
playerCam.fieldOfView = Mathf.Lerp(playerCam.fieldOfView, stretchedFOV, Time.deltaTime * transitionSpeed);
}
else
{
// Return to normal
playerCam.fieldOfView = Mathf.Lerp(playerCam.fieldOfView, normalFOV, Time.deltaTime * 2f);
}
}
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
playerCam = Camera.main; // Find the camera
isOnStairs = true;
}
}
void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
isOnStairs = false;
}
}
}