- Home /
Particle scaling
I'm instantiating a particle system and setting it's x localscale to 1 or -1 depending on it's parent orientation, however it's sub emitters aren't flipping with the main particle system, if I use children instead of sub emitters the children don't flip with the parent either.
How do i have multiple particle systems or sub emitters follow the paren't localscale?
Answer by Khena_B · Jul 14, 2017 at 03:28 PM
It seems that there is no way to spawn particles in a specific orientation in a 2D game other than by using some complicated method such as orienting all the particles and sub emitter particles in code or having a specific hierarchy for the hierarchy scaling mode to work.
My solution was to get rid of my player's parent to have him as the root in the hierarchy, which is not what i wanted, then when instantiating the particles, parent them to my player, then set their localscale to (1,1,1), and then set their particle system scale mode to hierarchy, this is the only way that i found to spawn particles with sub emitters attached to my player and facing the same orientation. Hopefully i am doing something wrong because having to do all this makes no sense to me.
I'm working in a 2D view game with unity 2017.I was found the same problem , I have a little puzzles about your soulution. 'then when instantiating the particles, parent them to my player, then set their localscale to (1,1,1), and then set their particle system scale mode to hierarchy' do these steps in runtime can let particle system flip(facing the same orientation)?
Answer by ifurkend · Jul 14, 2017 at 07:17 AM
First make sure scaling mode of your sub/child emitter is "hierarchy". Second, some older version of Unity would ignore negative scale for specific simulation space, so you may switch simulation space in main module, or just update your Unity.
I'm using unity 2017.1, also changing to hierarchy scaling mode doesn't make a difference, i think hierarchy looks at the root parent which is not the parent i want.
Have you parented your sub emitter under the particle system which has its localScale modified on instantiation?
I have a particle system which has a sub emitter, in the hierarchy this sub emitter appears as a child of the particle system.
When i instantiate this particle system i set the player as it's parent. It then scales with the player properly, but it's sub emitter does not.
I've even tried having my player as the root parent and use the "hierarchy" scaling mode and it doesn't work, this is driving me insane.
Answer by Ivgenii · Feb 06, 2018 at 11:12 PM
You can create 2 particle system (first, scale = -1 second, scale = 1) if facingright - play first, if !facingright - play second one, if you flip stop both particle system. I use it in my "battle world" pixel art game and it work perfect.
Your answer
Follow this Question
Related Questions
How to Prevent Child Deformation on Rotate? 1 Answer
C#: Particle Prefab doesn't follow it's parent (sort of) 0 Answers
How to rotate/scale a prefab instance from the GUI? 2 Answers
Rotating and scaling children 1 Answer
Rotate the textures in the particle system to direction of the particle system? 1 Answer