My player is baked entity in subscene while main camera is outside on scene. For some reason system cannot find transform of camera, GameObject was found though.
public partial class CameraFollow : SystemBase
{
Transform PlayerCamera;
protected override void OnCreate()
{
PlayerCamera = GameObject.FindWithTag("MainCamera").transform;
}
protected override void OnUpdate()
{
var PlayerPosition = SystemAPI.GetComponentRO<LocalTransform>(SystemAPI.GetSingletonEntity<PlayerTag>());
PlayerCamera.position =
new Vector3(PlayerPosition.ValueRO.Position.x, PlayerPosition.ValueRO.Position.y, PlayerCamera.position.z);
}
}
TransformAccessArray- and I think it's a good illustration of how the complexity of ECS is not a good fit for work you need to do for only one object once per frame. \$\endgroup\$