I am making my first visual effects, and I make effect, when my ship is flying. So I am want to play it only when the ship is actually moving. I would suppose it's easy, you call Play(), it will play. You play Stop() it will stop. But when I call play, nothing happens.
public void Update()
{
_ship.Rotate(Input.GetAxis("Horizontal"));
var move = Input.GetAxis("Vertical");
_ship.Move(move);
if (move > 0)
{
FlyEffect.Play();
FlyEffect.SetVector3("Velocity", new Vector3(0, -_ship.Speed * move, 0));
}
else
{
FlyEffect.Stop();
}
}
When I let in Initial Event Name OnPlay, it is playing as it should be. But nothing from the script... What I am missing here?