Search Unity

Question 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.