Question by
andyoverton · Dec 07, 2017 at 05:42 PM ·
c#particlesshuriken
Trouble using SetParticles for position
Hi I am trying to alter the position of particles in my particle system. Using the code below, my particles aren't moving and are just staying static.
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class NewParticles : MonoBehaviour { public ParticleSystem pSystem; ParticleSystem.Particle[] pParticles; private float particlecheck;
void Start () {
}
void Update () {
ParticleSystem.Particle[] allParticles = new ParticleSystem.Particle[pSystem.particleCount];
pSystem.GetParticles(allParticles);
int pCount = allParticles.Length;
for(int i = 0; i < allParticles.Length; i++){
var p = allParticles[i];
p.position += new Vector3(0,1,0);
print (p.position);
}
pSystem.SetParticles(allParticles,pCount);
} }
Comment
Your answer
Follow this Question
Related Questions
Aoe potion with drag and drop? 0 Answers
how to activate a particle when bullet hits a collider? 1 Answer
Unity Spline Particle Emission 0 Answers
How to make a particle effect do damage? 4 Answers