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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

How to make sprite mask only apply to only specific sprites

Discussion in 'Scripting' started by AnalogUniverse, Nov 4, 2018.

  1. AnalogUniverse

    AnalogUniverse

    Joined:
    Aug 10, 2018
    Posts:
    63
    Hi All

    Im trying to make a slider script, which creates 4 child game objects

    SliderFull spriteRenderer
    SliderEmpty spriteRenderer
    SliderMask spriteMask
    SliderPin spriteRenderer

    Ive set the mask interaction for the SliderFull to Visible inside mask and
    Ive set the mask interaction for the SliderEmpty to Visible Outside mask

    Which works but there is no simple option to specify which spriteMask to use and I only want the SliderFull and the SliderEmpty sprites to use the mask, I intend to have several sliders and GameObjects in my project which will need their own "separate" spritemasks, so how do I ensure that this instance of SliderMask only Applies to this instance of SliderFull and SliderEmpty ?

    Thanks
     
  2. puddleglum

    puddleglum

    Joined:
    May 11, 2020
    Posts:
    380
    sorry to post on a dead thread but did you ever figure this out?