Spawn particles with the rotation of the emitter...

…using Simulation Space World, I can get the desired rotation I want by choosing to simulate based on Local space but I need the already spawned particles to be left behind because the emitter is moving, but I also need that the particles gets spawned with the same rotation of the emitter.

Is there a way to do this? It’s a pretty basic thing, but I can’t find a way to do it…

you’re trying to spawn particles in world space like a trail for a comet but still inherit the rotation of the emitter?

Yes, I want it to inherit the rotation of the emitter (to be more correct, the ParticleSystem is nested under another two objects, but I want to inherit its world space anyway). I’m trying to make footsteps, I was spawning quads and destroying them but I want to use particles for it instead because it’s more perfomant.

yah that won’t work the way you want.

you’ll want to spawn an emitter outside your characters hierarchy based on foot location according to an event and use local_space. foot steps that use the same material will batch

2 Likes

I got it!! Every time I call play on my particle system, before, I set the startRotationY of them to my character’s Y euler angle, it works!

I will start a feedback entry for world space particles inherit emitter rotation though.

1 Like

awesome that you got the code skills to do it.

but wait I think align_to_direction is what you want in the shape tab. i think this was added to allow you to fling a deck of cards in an arc. Eh it’s not working the way you’d want either

2 Likes

Ah, yes, this works! I spent 1 hour trying to understand how it works, it seems like it doesn’t work with meshes, I was using a quad mesh and it was not aligning, I switched back to billboard now it works! Thanks a lot!
The results:

Edit: ah, nevermind, this way, the particles spawned previously changes their direction when the emitter changes too, I just want to inherit the rotation in the spawn process… I will need to set the startRotationY…

I’ve only briefly read all this, so, I may be wrong, but take a look at the Render Alignment in the Renderer module. Try setting it to Local.

1 Like

3059539--229831--ezgif-2-97a8efc9a3.gif
I tried a few combos of alignment in shape/render tab and they inherit rotation continuously rather than at birth only.

2 Likes

You probably not gonna like this, but updating the transform.eulerAngles of the particle system object to the 3D start rotation of the particle system is probably the most straightforward approach (may still need to ± 90deg of each axis to the resultant rotation). Of course it still requires using the “world” billboard alignment but you can disable the shape module which is pointless now.

2 Likes

I’ve added an item to our roadmap to make this easier.

In theory, I think you should use Align to Direction to achieve this. However, the problem is that this locks you into Local Render Alignment. This means future emitter rotations also rotate the existing particles, which you have discovered.

What I think we need to do, is allow World Render Alignment in this mode too, so old particles aren’t affected by new emitter rotations.

For now, I hope one of the suggested workarounds gets you what you want! :slight_smile:

2 Likes

nice!

i’m concerned when using mesh renderer … well let’s say I’m imagining a character throwing saw blades with slight start_rotation randomness + rotation over lifetime gyroscopic + pivot offset

interaction between start_rotation + world_based + shape_align_world + rotation_over_life + pivot_offset whew

Haha yeah that’s a lot of different factors to get working together!

Simulation Space Local is not an option for me since the particle system is nested in the character, this way if I set to local the particle will spawn with the same rotation of the feet (ok) but the character will “carry” those already spawned particles/footsteps with him, I have the shape module disabled because I don’t want them to spawn within a space range, nothing new there, I want them to spawn in a fixed point.
So my current setup is Simulation Space: World, no shape, BUT, the particles always gets spawned facing the world.forward so I using my third post’s method, setting startRotationY (I’m using a custom mesh which is a quad facing up, can’t remember why using horizontal billboard wasn’t working for me) before calling Play().

Yes, exactly what I’m doing. You have some cool particles btw!

Maybe a “Align only at birth” bool?
Thanks! The more options the best!

Things can get a little messy, haha… but, as long as it works we are good!

Thanks for the replies guys, everything is working now!

2 Likes

Oh, just one more thing, I needed to invert the sign of transform.eulerAngles.y * Mathf.Deg2Rad, I was getting a mirrored rotation, forward and back was alright but left and right was inverted, the value in the start rotation field was correct, but the particle rotation itself was mirrored.

well I couldn’t leave it alone and in 2017.1.0.b3 (BETA) i got it working
3062164--230103--shoes_02.gif

  • simulation space = World
  • renderer>render_alignment = ‘velocity’
  • renderer>render_mode > Mesh = Quad
  • start speed = .001 (< important to establish a minimal vector)
  • start rotation 90,0,-90 **

two emitters with offset timing, size 2:1 each uses an atlas image 0 and 1

dont quite understand this
3062164--230104--upload_2017-5-8_12-18-33.png
when the local rotation was 90,90,180 the blue/red shoes just don’t get the velocity right and don’t work… very odd :frowning:

EDIT ** Start Rotation 90,0,-90 and the shoes are aligned correctly oriented for Stretch billboard ;0
3062164--230125--upload_2017-5-8_13-48-13.png

12 Likes

That’s odd… does a slightly higher start speed fix it?

Nice job getting it working!

no dice on speed,
but local 0,0,0 now I got it, works fine
use 3D rotation 90,0,-90 to get the quad rotated correctly ; (maybe a gimbal issue?)

note* using velocity_over_lifetime [local] the issue presents as before with local rotation continuing to update (red shoes)


mm this would seem intended imo

2 Likes

I dont see align to velocity anywhere in the renderer. You mention you choose mesh > quad, but there is no such thing. Well there is - but if i choose mesh then select a quad (also the standard quad) then that is still just an ordinary mesh.
3207709--245459--upload_2017-9-4_11-57-30.png

3207709--245458--upload_2017-9-4_11-57-7.png

This mode is only available from Unity 2017.1, so update your editor.