Trying to make a dust particle when the the player moves

Hi Everyone,

I am creating when my player moves it creates a dust trail after him only when they move.

I have made an event trigger in the animation when the player moves but it isn’t removing the prefab from the game world.

Anyone able to shed some light on this?

public class smokePuff : MonoBehaviour {

public GameObject pSmoke;
public Transform pointSmoke;

// Use this for initialization
void Start () {


// Update is called once per frame
void Update () {

void Smoke()
    Instantiate (pSmoke, pointSmoke.position, pointSmoke.rotation);
    Destroy(pSmoke, 1);


You don’t need script for this. Just change the dust emission from “over time” to “over distance” and make sure it’s in World simulation space. This way the dust particles are emitted when the object position changes.