I have a very simple script that when “isMoving” is checked should;
- start moving the object left
- play the particle system
however, lol…what is happening instead baffles me.
The object will move but the particle system does not play until…
I unchecked “isMoving”. At that point, the object obviously stops moving and then the particle system kicks in! It’s completely backwards!
#pragma strict
var speed: float = 05;
var myEffect: ParticleSystem;
var isMoving: boolean = false;
function Start ()
{
myEffect.Stop ();
}
function Update ()
{
if (isMoving)
{
Rolling ();
}
}
function Rolling ()
{
myEffect.Play ();
transform.Translate(Vector3.left * Time.deltaTime * speed );
yield;
}