#Why isn't LocalTransform on my gameobject?

1 messages · Page 1 of 1 (latest)

thorn snow
#

I created a capsule gameobject inside a subscene and added an input component / system onto it along with a baker. However, when I look at the components it has, it doesn't have a LocalTransform component. Am I doing something wrong?

thorn snow
#
using UnityEngine;

public struct PlayerInput : IComponentData
{
    public int Horizontal;
    public int Vertical;
}
public class PlayerInputAuthoring : MonoBehaviour
{
    class Baking : Baker<PlayerInputAuthoring>
    {
        public override void Bake(PlayerInputAuthoring authoring)
        {
            TransformUsageFlags transformUsageFlags = new TransformUsageFlags();
            Entity entity = GetEntity(transformUsageFlags);

            AddComponent<PlayerInput>(entity);
        }
    }
}```
full coral
#

default equals to None - meaning your Baker does not rely ont ransforms at all

#

and since nothing else adds flags for LocalTransform

#

it's not added