Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Light Affected Particles 2D

Discussion in '2D' started by JonahSagers, Apr 25, 2022.

  1. JonahSagers

    JonahSagers

    Joined:
    Oct 5, 2021
    Posts:
    5
    I'm trying to make a game about keeping a campfire lit, in order to see. I want everything outside of the fire radius to be obscured. I've just used lights to darken the other objects, but the cloud particles (shown by the arrow in the picture) won't respond to the light no matter what sorting layer I put them on.

    I suspect that it's due to the material, which is currently Default-Particle, but I don't know what to change it to.

    Any help is greatly appreciated
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    Good bet. Default-Particle is actually mapped to this:

    Screen Shot 2022-04-25 at 12.04.24 PM.png

    Try perhaps this one:

    Screen Shot 2022-04-25 at 12.12.59 PM.png

    I can never make this one work the way I want with PNG files, so I use a TGA file, which can actually represent full-alpha. Texture is also included in complete scene - try toggle the light. Be sure to set your scene lighting fully black in the Lighting Window.
     

    Attached Files:

    Last edited: Apr 26, 2022
    JonahSagers likes this.
  3. JonahSagers

    JonahSagers

    Joined:
    Oct 5, 2021
    Posts:
    5
    Update: I probably should have mentioned this earlier, but I'm using the universal render pipeline which has a different system for materials.

    Using your assets didn't work for me, and they stayed in full clarity regardless of the lights affecting it.

    I'll probably just resort to using a layermask, but I'd prefer not to.

    If it makes a difference, I'm on 2020.3.32f1
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    There will be an equivalent (or analogous) option. I cannot tell you what it is because I haven't used URP enough. But I assure you it is there.
     
  5. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    254
    If you are using the 2D Renderer and want lit sprites you should choose the Sprite-Lit-Default material. If you don't see it try clicking this button.

    upload_2022-5-1_17-49-55.png