How To change the 3DstartRotation of a ParticleSystem, using another GameObject Rotation?
I'm trying to cast a skill in my game So i created a particle system , enable the 3DstartRotation(becauser the particle was not facing the correct direction), and adjusted the y to be 90°
But, when i instantiate the particle, that is child to a EmptyGameObject, called spell, she did't chance his rotation.
I tryed
public class ParticleRotation : MonoBehaviour {
public ParticleSystem thisParticle;
public Transform shotRotation;
void Start () {
thisParticle = GetComponent<ParticleSystem> ();
var main = thisParticle.main;
main.startRotation3D = true;
}
// Update is called once per frame
void Update () {
var main = thisParticle.main;
main.startRotationY = Mathf.Deg2Rad*90 + shotRotation.transform.rotation;
}
}
But did not work so, in simple words, i just need to cast my Spell in the direction that my player is facing. And because my skill have a thin look, i need to change his in some way.
ty for the help. Sry grammar.
Answer by ifurkend · Dec 11, 2017 at 01:58 AM
You don't need to do it in script, if your particle is billboard, change "render mode" in renderer module to "stretched billboard". For mesh particle, change "alignment" property to "facing", This option is only available from 2017.1.