- Home /
Trouble setting particle system startRotation through c#
Hello, I am trying to set ParticleSystem.startRotation in c# script. Is this possible?
I am trying to create a particle that makes a trail behind a parent object, I have set the particle system to world coordinates because I don't want the particles to follow the parent object, however setting the particle to world coordinates prevents the particle from rotating with the parent which is why I am trying to correct this with script.
This is what I am trying to change in script but I have been unsuccessful thus far, any help would be greatly appreciated. http://docs.unity3d.com/ScriptReference/ParticleSystem-startRotation.html
Or if anyone can tell me how to get a particle set on local orientation to remain stationary when spawned that would accomplish the same thing.
ParticleSystem.startRotation is $$anonymous$$ethod group is Obsolete, any ideas what's replaced it, there seems to be no way to rotate a particle that i can find
Answer by Paradox486 · Oct 29, 2014 at 03:19 PM
I figured it out.
public class ParticleRotation : MonoBehaviour {
private float startRotation;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
this.particleSystem.startRotation =-80;
}
}
Yes you can, but you have to convert to radians first. -> http://docs.unity3d.com/ScriptReference/ParticleSystem-startRotation.html
this.particleSystem.startRotation = -80f * $$anonymous$$athf.PI / 180f;
Your answer
Follow this Question
Related Questions
remove parent of particles while emiting? 0 Answers
VFX Particle strip causes crash 2 Answers
VFX particle invisible on a certain perspective, 1 Answer
shuirken particle system and colliders2d 0 Answers