- Home /
Question by
joachimbarrum · Nov 14, 2012 at 03:03 PM ·
followpathshuriken
Shuriken particles following a path
Is there a is there a way to make the shuriken particles follow a path of some sort ?
Comment
Best Answer
Answer by CodeMasterMike · Nov 14, 2012 at 04:03 PM
You can access each individual particle and change its position. So maybe you calculate a Lerp position from Start position and a position from a pre-created Path.
m_currentParticleEffect = (ParticleSystem)GetComponent("ParticleSystem");
ParticleSystem.Particle []ParticleList = new ParticleSystem.Particle[m_currentParticleEffect.particleCount];
m_currentParticleEffect.GetParticles(ParticleList);
for(int i = 0; i < ParticleList.Length; ++i)
{
ParticleList[i].position= PathVector;
}
m_currentParticleEffect.SetParticles(ParticleList, m_currentParticleEffect.particleCount);
Your answer
Follow this Question
Related Questions
How do I instantiate a projectile along the path of a raycast? 0 Answers
Dog chasing my player on curved path? 2 Answers
Need Help: Unity draw-to-follow? 0 Answers
Object following the path 3 Answers
Selectable Paths 1 Answer