- Home /
Question by
studioglitch · Jun 13, 2018 at 01:10 PM ·
c#scripting problemparticlesparticlesystem
How do i change the position of my particle system
I want to change the position.x value of this particle using c#. How can I do this?
capture.png
(10.5 kB)
Comment
Answer by bakir-omarov · Jun 13, 2018 at 02:08 PM
You can't directly change it. But you can use ShapeModule .
public class ParticleSystemShapeChanger: MonoBehaviour
{
private ParticleSystem m_particleSystem;
private void Start()
{
m_particleSystem = GetComponent<ParticleSystem>();
ParticleSystem.ShapeModule _editableShape = m_particleSystem.shape;
_editableShape.position = new Vector3(1f, 2f, 3f);
}
}
Your answer
Follow this Question
Related Questions
Can you change the Velocity Over Lifetime of a Particle System using a Script? 3 Answers
Assign random start lifetime for particle system from script 2 Answers
Turning my grid of particles into a sphere 0 Answers
Particle Systems wont stop/play 0 Answers
How to make an effect in a particle system so that it is always behind the sphere? 1 Answer