I have created object with Convert to entity component (Convert and Inject) and added CopyTransformFromGameObject component. So that if I move the game object, then the entity must follow it? But this does not happen. The entity remains in place.
With CopyTransformToGameObject - it works fine. Injected gameobject follows an entity.
So you added CopyTransformFromGameObjectProxy right?
That workflow is obsolete now but it should work. Anyway the thing is that it also adds GameObjectEntity which will create an extra entity.
What i suggest is that you create your own conversion for CopyTransformFromGameObject component data like this:
using Unity.Entities;
using Unity.Transforms;
using UnityEngine;
public class MyCopyTransformFromGameObjectProxy : MonoBehaviour, IConvertGameObjectToEntity {
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) {
dstManager.AddComponentData(entity, new CopyTransformFromGameObject());
}
}
CopyTransformFromGameObject is processed by CopyTransformFromGameObjectSystem where transform values are copied to the entity LocalToWorld component data but you can also look at the source in Unity.Transforms package.