- Home /
Question by
unity_7y-ogglWzGx8bw · Mar 01, 2019 at 08:45 PM ·
particlesrespawn
Why is the particles not showing when player dies, it works fine on it's own but not when it hits a hurt object?
I am trying to add a particle effect to my player when it dies and hits a hurt object. I have tested the particle effect on its own and its working fine. It's when the player hits the hurt object the particle effect isn't showing but I can see that it's hitting it from looking at the sidebar it says deathSplosion(Clone)(see image attached). I have created the particle effect as a prefab and added it to the levelManager (see image attached).
Does anyone know why the particle effect isn't appearing when the player hits a hurt object? Thanks! ![alt text][1] ![alt text][2]
public class LevelManager : MonoBehaviour {
public float waitToRespawn;
public PlayerController thePlayer;
public GameObject deathSplosion;
// Use this for initialization
void Start () {
thePlayer = FindObjectOfType<PlayerController>();
}
// Update is called once per frame
void Update () {
}
public void Respawn()
{
StartCoroutine("RespawnCo");
}
public IEnumerator RespawnCo()
{
thePlayer.gameObject.SetActive(false);
Instantiate(deathSplosion, thePlayer.transform.position, thePlayer.transform.rotation);
yield return new WaitForSeconds(waitToRespawn);
thePlayer.transform.position = thePlayer.respawnPosition;
thePlayer.gameObject.SetActive(true);
}
}
screen-shot-2019-02-27-at-144257.png
(22.4 kB)
screen-shot-2019-02-27-at-144303.png
(38.2 kB)
Comment
Your answer

Follow this Question
Related Questions
particle collision with objects not working. 0 Answers
Blood "Explosion" Effect 2 Answers
Make raycast ignore some objects. 2 Answers