TEST: trap and shakecam

This commit is contained in:
manhduyhoang90
2026-05-18 21:22:34 +07:00
parent 5025383676
commit b7e2c80488
151 changed files with 23277 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeathTrapCollision : MonoBehaviour {
private void OnTriggerEnter(Collider other) {
// Check if the object colliding with the trap is the player
// Assumes the player character (e.g., Bob) has the tag "Player"
if (other.CompareTag("Player")) {
// Trigger the Game Over event via the GameManager
FindObjectOfType<GameManager>().TriggerGameOver();
// Destroy the player object upon collision
Destroy(other.gameObject);
}
}
}