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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[SOLVED] Can't set RectTransform

Discussion in 'Scripting' started by ProExCurator, Mar 5, 2020.

  1. ProExCurator

    ProExCurator

    Joined:
    Jan 2, 2020
    Posts:
    87
    upload_2020-3-5_23-34-0.png

    I don't have option to set it.

    but if I'm not wrong there should be something like this:
    upload_2020-3-5_23-49-16.png

    What am I doing wrong? Is this because this is image? I tried with text there is the same issue. Help pls
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    Does that GameObject have a parent? A RectTransform expresses relations to parents, so a GameObject at the root will have certain relations baked in. There are other limitations placed on RectTransform parameters with Canvas objects on them too. Also, layout components can freeze certain of those available fields because the layout is driving them.
     
    Raine66252 and ProExCurator like this.
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,151
    UI components should be under a Canvas gameobject for certain reasons, but if you place the Image under any object that does not have a rect transform itself, then you can't adjust it. Example is if you create an empty gameobject that has a transform component, then drag the image gameobject under it, it will not let you adjust that section.
     
    vicorintias and ProExCurator like this.
  4. ProExCurator

    ProExCurator

    Joined:
    Jan 2, 2020
    Posts:
    87
    Thanks
     
  5. unity_qCJMzrGkwMTK9Q

    unity_qCJMzrGkwMTK9Q

    Joined:
    Aug 25, 2019
    Posts:
    1
    You saved my day! Thanks