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

how to modify scale on an entity?

Discussion in 'Entity Component System' started by tommox86, May 27, 2019.

  1. tommox86

    tommox86

    Joined:
    Apr 30, 2015
    Posts:
    81
    i have an image which has the convert to entity and inject gameobject script with the scale component attached set to value = 1. no matter what value i set scale to it doesnt modify the scale. how do i modify scale of an entity?
     
  2. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    910
    Not sure why it doesn't work.

    The data that is utilized by the renderer is the LocalToWorld matrix component.
    You can use Matrix4x4.TRS(position, rotation, scale) to set the value.
     
    h_kardan likes this.
  3. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    What is the scale component that you have attached? You don't need to attach anything for the scale. If the scale is different than 1 the conversion workflow will add a NonUniformScale component with whatever you have.
     
    Flurgle likes this.
  4. tommox86

    tommox86

    Joined:
    Apr 30, 2015
    Posts:
    81
    Thanks for the input guys! i figured it out. an image will not be converted to an entity. how i fixed this was i converted the image to a mesh which can be converted to an entity. once i converted i could then manipulate scale via NonUniformScale
     
  5. h_kardan

    h_kardan

    Joined:
    Dec 24, 2022
    Posts:
    2
    THANKS in advance