#Entity does not have LocalTransform

1 messages · Page 1 of 1 (latest)

rigid coral
#

I am just starting out and trying to wrap my head around the DOTS workflow. I figured let's just get something to appear and move.

I added a cube to SubScene and then created a SystemBase that will grab anything with a LocalTransform and move it forward. In play mode, my System's Entity Count is 0, nothing happens, and the cube Baking Preview says that it does not have a LocalTransform component. What am I doing wrong?

using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;

public partial class Move : SystemBase
{
    protected override void OnUpdate()
    {
        float deltaTime = SystemAPI.Time.DeltaTime;
        Entities.ForEach((ref LocalTransform transform) =>
        {
            transform.Position += deltaTime * new float3(0, 0, 1);
        }).Schedule();
    }
}
#

Entity does not have LocalTransform

opal dove
#

actually no need to add component, simply specifying TransformFlags will do