Hi, I’m a beginner to ECS stuff, but I just spent 2 hours trying to find out why instantiated entities are not rendered. I came to realize that instead of keeping the same scale, or applying the scale so it keeps the size but the scale turns into 1, the baking process just sets the scale to 1 and resets the rotation as well.
In my case, I think the reason why the scale was not baked is because I use TransformUsageFlags.Dynamic in my baker method here:
public class Baker : Baker<TreeAuthoring> {
public override void Bake(TreeAuthoring authoring) {
Entity entity = GetEntity(TransformUsageFlags.Dynamic);
AddComponent(entity, new Tree());
}
}
However, the documentation for “Enum TransformUsageFlags” states that “The Dynamic flag replicates as close as possible the GameObject data and structure.” English is not my first language so I might misunderstand this, but it sounds like the scale should be baked. However, at the bottom of the page the documentation states that “Dynamic: Indicates that an entity requires the necessary transform components to be moved at runtime” and that NonUniformScale is used for scale.
So my main questions are:
-
What could be the reasoning behind not baking the scale and rotation into an entity, if the instantiated entity still has both fields on its Local Transform component?
-
How to use 2 different TransformUsageFlags so that I can keep the scale but also be able to move the Tree entity so that I can spawn it in a certain location? The documentation for “Transform usage flags” states that it can be done but doesn’t show how.