Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

changing the alpha of a game object by clicking on another gameobject

Discussion in 'Getting Started' started by luffyy-Sarah48, Jun 6, 2019.

  1. luffyy-Sarah48

    luffyy-Sarah48

    Joined:
    May 10, 2019
    Posts:
    3
    am very new to this and am trying here to write script where i can change the alpha of a gameObject 1 by clicking on another gameobject 2 .
    Ps:
    the gameobject 1 is an Empty conatainig gameobject2 and onther gameobject.
    i know it's quit a mess
    please help
     
  2. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    411
    Hey Luffy,

    What kinds of objects are these? UI, 3D or 2D?

    Furthermore, if gameobject 1 is an empty (I'm assuming you mean nothing but a transform with no renderers), then there's nothing to change the Alpha on... is there?

    BTW, welcome to the Unity forums ;)
     
  3. luffyy-Sarah48

    luffyy-Sarah48

    Joined:
    May 10, 2019
    Posts:
    3
    they are 2D objects .

    oww i see . but i wanted to link the two objects to each others so i put it them into an empty ... is there another way ? where i can keep the object's renderers ?


    and thank you