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.

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.