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. Dismiss Notice

Question How to scale a entity in a non uniform way?

Discussion in 'Entity Component System' started by Gray_FoxWare, Mar 13, 2023.

  1. Gray_FoxWare

    Gray_FoxWare

    Joined:
    Jan 31, 2019
    Posts:
    10
    how do I change a entities scale in a non uniform way?

    I want to scale up and down on the transform scale y and leave the x and z the same.

    been struggling to find answers.

    the best answers i could find was this in the documentation,could anyone give me a simple example?

    https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/transforms-concepts.html




    is it telling me to get a entities WorldToLocal Component and set it to its WorldTransform Component .Matrix() Value Multiplied by a PostTransformScale Component?(I tried that and got code errors.)
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,653
    It's not telling you that. It's telling to just use your scaling matrix in PostTransformScale the rest is up to TransformSystem.
    upload_2023-3-13_9-43-42.png
     
    Gray_FoxWare likes this.
  3. Goularou

    Goularou

    Joined:
    Oct 19, 2018
    Posts:
    50
    Looks like now one must use PostTransformMatrix instead, and choose well the TransformUsageFlags (here in my case Dynamic).