- Home /
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);
}
}
Answer by ifurkend · Mar 17, 2018 at 10:47 PM
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.
Your answer
Follow this Question
Related Questions
How can I emit animated prefabs from a particle system? 0 Answers
Partical System is not visible 1 Answer
How can I play an explosion animation? 3 Answers
Emit Particle on Collision Issue 0 Answers