К примеру вот
Когда падает на die collider умирает и продолжает падать пока не Респавнится а это через 1 сек, так сделать чтобы он не падал?
using UnityEngine;
using System.Collections;
public class LevelManager : MonoBehaviour {
public GameObject currentCheckpoint;
private characterController Hero;
public GameObject deathParticle;
public GameObject respawnParticle;
public int pointPenaltyOnDeath;
public float respawnDelay;
private CameraController Camera;
//private float gravityStore;
//public HealthManager healthMnager;
// Use this for initialization
void Start () {
Hero = FindObjectOfType<characterController> ();
Camera = FindObjectOfType<CameraController> ();
//healthMnager = FindObjectOfType<HealthManager> ();
}
void Update () {
}
public void RespawnPlayer()
{
StartCoroutine ("RespawnPlayerCo");
}
public IEnumerator RespawnPlayerCo()
{
Instantiate (deathParticle, Hero.transform.position, Hero.transform.rotation);
Hero.enabled = false;
Hero.GetComponent<Renderer>().enabled = false;
Hero.GetComponent<Rigidbody2D>().velocity = Vector2.zero;
ScoreManager.AddPoints (-pointPenaltyOnDeath);
Debug.Log ("Player Respawn");
yield return new WaitForSeconds (respawnDelay);
//Hero.GetComponent<Rigidbody2D> ().gravityScale = gravityStore;
Hero.transform.position = currentCheckpoint.transform.position;
Hero.enabled = true;
Hero.GetComponent<Renderer> ().enabled = true;
//healthMnager.FullHealth ();
//healthMnager.isDead = false;
Camera.isFollowing = true;
Instantiate (respawnParticle, Hero.transform.position, Hero.transform.rotation);
}
}