VR/Assets/Suicide.cs

19 lines
414 B
C#
Raw Normal View History

2024-01-07 11:14:29 +01:00
using UnityEngine;
2024-01-07 13:00:44 +01:00
using UnityEngine.SceneManagement;
2024-01-07 13:01:21 +01:00
2024-01-07 11:14:29 +01:00
public class Suicide : MonoBehaviour
{
// This method is called when a collision occurs
2024-01-07 12:36:39 +01:00
2024-01-07 11:14:29 +01:00
private void OnCollisionEnter(Collision collision)
{
// Check if the collision is with the specific object you want
if (collision.gameObject.CompareTag("Bullet"))
{
2024-01-07 13:00:44 +01:00
SceneManager.LoadScene("AfterLife");
2024-01-07 11:14:29 +01:00
}
}
2024-01-07 12:36:39 +01:00
2024-01-07 11:14:29 +01:00
}