- Home /
Shuriken Particles - Horizontal Billboard doesn't draw full size (but normal Billboard does)
I have a 2D top-down game and I'm currently trying to draw a 'slime trail' that a character leaves as he moves. It is a grid-based game so I have drawn the required variations of slime (corners, crosses, straight lines, etc.) and am using them as a sprite sheet for the particle. These are then set using the Texture Sheet Animation.
Note: I understand the expected behavior of "Max Particle Size" in the Particle System Renderer can be used to scale sprites down based on distance. The value is set to 1 (which should allow it to take up to full screen). A value greater than one has no effect.
However, when I go to draw them using Render Mode: Horizontal Billboard, Max Particle Size: 1, Starting Size: 1 they show up taking less than a full square. This can be seen here:
(Each white cube in the scene is the standard 1mx1m square)
The particles are initialized and positioned via the following code:
var particle = new ParticleSystem.Particle();
particle.lifetime = 0.5f;
particle.startLifetime = 4f;
particle.position = new Vector3(x, 0, z);
particle.size = 1f;
particle.color = new Color32(255, 255, 255, 255);
As you can see the size and max size are set to one. The particles stay the same size regardless of the distance of the camera to the particle (which is the expected behavior).
The only way to get the particles to draw as expected is to set the Particle System's Render Mode to "Billboard" instead of "Horizontal Billboard". When this is set the particles become the size they are expected to and don't change size based on the camera's distance (expected behavior).
This however presents a problem: If the camera does not face straight down then the particles will render as typical billboards:
This obviously ruins the effect. So my question is:
Why does Render Mode: Horizontal Billboard scale the sprite down?
Edit: This is Unity 4.2, targeting Android but appears in the editor with graphics emulation disabled, and on phone.
Did you ever figure this out? I've run into this aswell(2019.3), not sure if anything has changed since back then but I found that setting the size to 1.4142135 on the horizontal billboard one is pretty close to 1.0 in world size. Strange behaviour indeed, is this intended I wonder?
Answer by Garrettec · Oct 04, 2013 at 12:18 PM
Have resembling problem. We use effects with horizontal billboard for auras etc. Auras have dynamic radiuses which are set from code. And, like mentioned before - horizontalBillboard change size of the particle.
For me, right now the solution is to check if renderer set to horizontal billboard and if so, multiply my value on 1.4f, but this is just temporary workaround...
Answer by IgorAherne · Aug 26, 2017 at 09:09 PM
In renderer module, adjust minParticle size and maxParticle size.
They describe the minimum & maximum portion a particle can occupy on screen. Setting min to 0 and max to 1000 solved the issue of scaling the closer the camera comes to a particle
Min Particle Size The smallest particle size (regardless of other settings), expressed as a fraction of viewport size. Note that this setting is only applied when the Rendering Mode is set to Billboard.
Max Particle Size The largest particle size (regardless of other settings), expressed as a fraction of viewport size. Note that this setting is only applied when the Rendering Mode is set to Billboard.
No offense, but have you checked your answer? This particle strange behavior still here (4 years have left and it is still here) and it is not a problem with $$anonymous$$/max size, I just checked, see the image: https://prnt.sc/gdkhhh
Answer by Muuurphy · Aug 07, 2020 at 02:44 PM
To anyone looking for a solution years later, check out this post: https://forum.unity.com/threads/rotate-texture-particle-system-locally-when-using-horizontal-billboard.517741/
For me, setting the RenderMode to Billboard and then Render Alignment to Local did the trick. I also needed to rotate the transform of the ParticleSystem object to make it face the direction I wanted.