Search Unity

check layer order

Discussion in 'Scripting' started by Vindatra14, Nov 30, 2015.

  1. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    In unity can we check layer order from gameobject ??
     
  2. KeithKong

    KeithKong

    Joined:
    May 31, 2015
    Posts:
    73
    Type your exact sentence into google.

    :p
     
  3. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    can't find any at google, that's why I come here
     
  4. KeithKong

    KeithKong

    Joined:
    May 31, 2015
    Posts:
    73
    The very first result for your sentence is the Unity docs pointing you to "GameObject.layer".
     
  5. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    I can change the sorting order, I can manipulate the layer. But I can't check that layer number
     
  6. KeithKong

    KeithKong

    Joined:
    May 31, 2015
    Posts:
    73
    You're trolling me right? I literally just linked you to the page showing how to get the number.
     
  7. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    no I mean I change the layer use int layer, but how I can acces it without int layer at first. That script tell int layer first, then we can acces it with gameobject.layer. without int layer, how can I know the layer number that's I want to know, if is is can
     
  8. KeithKong

    KeithKong

    Joined:
    May 31, 2015
    Posts:
    73
    There's definitely a language barrier here, but without a gameObject there is no gameObject layer to check. That's all I can say haha
     
  9. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    hhmm ok, what I want to make is, I have gameobject a b and c, but when I click it a want that gameobject that I clik move upper behind other object, for example 1. object a b and c at layer 0, but when I click object b that object b move to layer 1 and become the upper object at 2d, then after that If I click object c that object c move to the upper layer than a and b. How can I make it if u have any idea