I made a simple spaceship that has a particlesystem. When I press "space" button, spaceship should fly and particle system should instantiate and play. But it's not playing. It seems in hierarchy as clone but not playing.
As you see, particle effect is instantiating but not playing. It should play at bottom of spaceship
Those are codes
void FlyShip()
{
if (Input.GetKey(KeyCode.Space))
{
rb.AddForce(Vector3.up * jumpForce);
if (!takeoffSound.isPlaying)
{
// _rocketJetParticle is gameobject.
_rocketJetParticle = Instantiate(rocketJetParticle, new Vector3(transform.position.x, transform.position.y - 4, transform.position.z), transform.rotation);
takeoffSound.Play();
}
}
else
{
//Destroy(_rocketJetParticle);
takeoffSound.Stop();
}
}