Hey!
I’ve been fiddling with a particle effect that splits into multiple particles at the end of it’s lifespan.
when the parent particle system is not rotated at all we don’t run into any problems and we get this effect:
Parent rotation 0, 0, 0. Sub emitter rotation 90, 0, (90 - arc / 2). camera rotation 0, 0, 0.
That’s sort of what we’re looking for. However, when I rotate the parent system to it’s side we get this bullshit:
Parent rotation 90, 0, -90. Sub emitter rotation (90, 0, 90 - arc / 2). camera rotation 90, 0, 0.
I think the problem is that the circle shape of the sub emitter is rotating around an axis, which turns the rotation of the “prongs” at poles perpendicular to the axis, but not the ones on the axis. The emission points along the way appear to be partly rotated. I’ve tried all sorts of rotations for both the parent and the sub emitter, but nothing seems to work.
The slight curve in the second picture is due to the gameobject following my mouse.
In case it’s of any use here’s the script for creating the sub emitter:
void Start()
{
if (enableSub)
{
Material particleMaterial = subMaterial;
var subSystemGO = new GameObject("SubSystem");
var subParticleSystem = subSystemGO.AddComponent<ParticleSystem>();
var subMain = subParticleSystem.main;
var subShape = subParticleSystem.shape;
var subEmission = subParticleSystem.emission;
var subModule = particleLauncher.subEmitters;
var subMode = ParticleSystemShapeMultiModeValue.BurstSpread;
subSystemGO.GetComponent<ParticleSystemRenderer>().material = particleMaterial;
subMain.startColor = Color.red;
subMain.startSize = subSize;
subMain.startSpeed = subSpeed;
subMain.startLifetime = subLifeTime;
subMain.simulationSpace = ParticleSystemSimulationSpace.World;
subShape.shapeType = ParticleSystemShapeType.Circle;
subShape.arc = subArc;
subShape.arcMode = subMode;
subEmission.SetBursts(new ParticleSystem.Burst[] { new ParticleSystem.Burst(0.0f, subNumOfParticles) });
subSystemGO.transform.SetParent(playertransform.transform);
subSystemGO.transform.Rotate(90, 0, 90 - subArc / 2);
subModule.enabled = true;
subModule.AddSubEmitter(subParticleSystem, ParticleSystemSubEmitterType.Death, ParticleSystemSubEmitterProperties.InheritColor);
}
Is there a way I can rotate the actual arc the subemitter particles are created from? Or maybe some other work around? Been stuck on this one for a hot minute.