I
I
Ivannavi5552021-02-18 14:33:55
Unity
Ivannavi555, 2021-02-18 14:33:55

How to make a small blackout at death?

I am creating a mini-game, I made a code so that when I fall into the abyss, I return to the respawn point. How can you add a slight darkening of the screen during, so to speak, death in the abyss, so that the transition is not very sharp. Here is the script:
using UnityEngine;
using System.Collections;

public class died : MonoBehaviour
{
[SerializeField] private Transform player;
[SerializeField] private Transform respawnPoint;

void OnTriggerEnter(Collider other)
{
player.transform.position = respawnPoint.transform.position;
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question