In Unity ECS: After instantiating an entity, the child entity's position is the preset value. But why is the scale different?

I hope to dynamically adjust the scale and position of the prefab when in the incubation pipeline. I use PostTransformMatrix to achieve this function. However, I find that for the entity created using the prefab, the default position of its child entity is initialized from the prefab, but the scale is not. Why is this?

here is my code

private void SpawnTopPipe(PipeConfig config, float yOffset) {
    float y = yOffset + config.pipeDistance * 0.5f;
    float x = config.enterX;

    var entity = EntityManager.Instantiate(config.pipePrefab);
    EntityManager.SetComponentData(entity, new LocalTransform {
        Position = new float3(x, 0, 0),
        Rotation = quaternion.identity,
        Scale = 1f
    });



    var childs = SystemAPI.GetBuffer<LinkedEntityGroup>(entity);

    foreach(var child in childs){

        if(EntityManager.HasComponent<PillarTag>(child.Value)){

            var transform = SystemAPI.GetComponentRW<LocalTransform>(child.Value);
            float scale = transform.ValueRO.Scale;
            
            var scaleMatrix = float4x4.Scale(0.5f,2,0.5f) * scale;
            SystemAPI.SetComponent(child.Value,new PostTransformMatrix{
                Value = scaleMatrix
            });

        }
    }
}

my prefab (top) and the run effect (bottom)

It can be seen that the position is the preset position (0, 1, 0) in the prefab. However, the final value of the scale is (0.5, 2, 0.5) instead of the expected (0.25, 2, 0.25).

Non-uniform scale in authoring would be getting baked into PostTransformMatrix since LocalTransform doesn’t support non-uniform scale. Instead of using the scale from LocalTransform, you should be multiplying the existing PostTransformMatrix by the matrix for the scaling factor you want to apply.

I used PostTransformMatrix for non-uniform scaling. My confusion lies in the fact that the non-uniform scaling value of the child entity created by the prefab is (1, 1, 1) instead of the (0.5, 1, 0.5) preset in the prefab, which makes me feel confused.

Please check the original PostTransformMatrix on the child in the prefab and on the corresponding instantiated entity when you don’t set it to a new value. Non-uniform scale values are baked to PostTransformMatrix from my observation on 1.3.5. If you’re using an old version, it could be a bug that has been patched.

Thank you very much. I observed the same. It should be a characteristic of version 1.3.5.