#StackBounty: #unity3d #rotation #particles #particle-system #decal Unity3D – Rotate Decal Particle from ParticleSystem to Match Normal

Bounty: 50

I am trying to use a ParticleSystem for Decals as a cheap alternative but am unable to align the particles with all normal surfaces.

This is the nearest i’ve got that gets all axis correct except for an inverted x axis. (can see it’s the wrong way round on building windows)

if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out RaycastHit hit))
{
    Quaternion rot = Quaternion.LookRotation(hit.normal);

    ParticleSystem.EmitParams emitParams = new ParticleSystem.EmitParams
    {
        position = hit.point + 0.01f * hit.normal,
        applyShapeToPosition = true,
        rotation3D = rot.eulerAngles
    };

    _particleSystem.Emit(emitParams, 1);
}

ParticleSystem Settings

ParticleSystem Settings

ParticleSystem Renderer Settings

ParticleSystem Renderer Settings

I have tried multiple methods over the past 24 hours and have now got myself lost even though I’m sure its something simple, any help would be much appreciated.

Sorry about the image sizes scaling them down messed with the text

Edit: The editor and project settings are 2020.3.15F2 using URP


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.