- Home /
Question by
EvanCheddar · Feb 25, 2019 at 05:04 AM ·
particlesgravityparticlesystemparticle system
How can I change the gravity modifier of a particle system through script?
Hello, I'm trying to access and change the gravity modifier of a particle system through script but i cant seem to figure out how to access it. I cant get it through get component and i've tried other methods to no avail. Thank in advance
Comment
Best Answer
Answer by ifurkend · Feb 25, 2019 at 06:32 AM
public ParticleSystem _ps;
ParticleSystem.MainModule _psm_main;
public float _gravity= 1f;
void Start()
{
_psm_main = _ps.main;
_psm_main.gravityModifierMultiplier = _gravity;
}
Your answer
Follow this Question
Related Questions
Make Start Color setting in particle system control _EmissionColor 1 Answer
Particle system not outputting what it's supposed to. 0 Answers
Is there a way to have a sub emitter inherit size over lifetime? 1 Answer
In a hierarchy of particle effect objects, is it possible to play only the selected object? 0 Answers