I am trying to have a system access a entities transform aspect and change just the Y on the scale.
Im having trouble figuring out how to change it. I have seen the scale is a float that changes the size in a uniform way.
the question marks are what i dont know.
protected override void OnUpdate()
{
foreach (
( TransformAspect transformAspect , RefRW < Branch> branch)
in SystemAPI.Query<TransformAspect, RefRW<Branch> >())
{
TransformAspect tAps = transformAspect;
tAps.??? += SystemAPI.Time.DeltaTime * branch.ValueRO.growRate;
}
}
https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/transforms-concepts.html
it mentions the:
The PostTransformScale component
Transform components only support uniform scale. To render nonuniformly scaled geometry, you may use a PostTransformScale (float3x3). This will be applied in the following manner:
LocalToWorld = WorldTransform.ToMatrix() * PostTransformScale
protected override void OnUpdate()
{
foreach (
( LocalToWorld locToWorld,WorldTransform worldTrans,PostTransformScale postTransScale, RefRW < Branch> branch)
in SystemAPI.Query< LocalToWorld,WorldTransform, PostTransformScale, RefRW<Branch> >())
{
locToWorld = worldTrans.ToMatrix() * postTransScale;
}
}
but i get an error on locToWorld = worldTrans.ToMatrix() * postTransScale;
it says Operator “*” cannot be applied to type float4x4 and PostTransformScale.
So just wondering what else I need to do.