Hi Chris - I'm trying to do this, along with the script you made. I can get the particles to turn on when the player starts walking (I have the particle system as well as the script on the sprite object of the player, as that has the animator on it). However, the particle system doesn't turn off when the player stops moving.
Trying it on the 2D demo - not sure if this is because Brian is using the 'Sprites Simple' system? I did try using an Animation Event, but I don't think this works with Sprites Simple, at least I didn't get any options in the Inspector for the animation event when creating one in the walk animation.
Add particles.Stop () to the else block - but the particles shouldn't loop or be over-long. The idea is that each time the Play function is called, that'll be a single particle step FX.
Comments
Attach a Particle System to the same object as their Animator and use Animation Events to call its Play function in their walk animations.
Does this still work if using Spine to animate the Player?
Spine has its own animation event system, details can be found here:
http://en.esotericsoftware.com/spine-unity-events
Otherwise, you can read an AC character's charState to determine if they are walking:
Hi Chris, do I attach the above object to the Players root or whichever object has the Animator attached?
Either - the variables are taken from the Inspector.
Hi Chris - I'm trying to do this, along with the script you made. I can get the particles to turn on when the player starts walking (I have the particle system as well as the script on the sprite object of the player, as that has the animator on it). However, the particle system doesn't turn off when the player stops moving.
Trying it on the 2D demo - not sure if this is because Brian is using the 'Sprites Simple' system? I did try using an Animation Event, but I don't think this works with Sprites Simple, at least I didn't get any options in the Inspector for the animation event when creating one in the walk animation.
Add particles.Stop () to the else block - but the particles shouldn't loop or be over-long. The idea is that each time the Play function is called, that'll be a single particle step FX.