Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted Brawl Stars Aim Effect

Discussion in 'General Graphics' started by marf, Feb 27, 2021.

  1. marf

    marf

    Joined:
    Jul 20, 2011
    Posts:
    124
    Hello, we would like to create a cone aim effect similar to Brawl Stars where the cone of the aim is cut in the point it collides with something.

    Example:



    Any ideas on how we could do that?

    Thank you,
    Marco
     
  2. yzRambler

    yzRambler

    Joined:
    Jan 24, 2019
    Posts:
    37
    Have an idea.
    First, the zone occupied by wall be made mask, generate a mask texture.
    Then, render the scan fan gameobject, dectecting whether the line between pixel and the vertex of cone is blocked (over cross a mask with the mask texture) in fragment shader stage. If true, the pixel will be ignored.
     
unityunity