I am tryiyng to get the ECS Physics Getting Started sample to work using Unity 2019.2.
Using the exact code from:
When this line is being executed:
entityManager.AddComponentData(entity, new Translation { Value = position });
The following exception is raised:
ArgumentException: The component of type:Translation has already been added to the entity.
Unity.Entities.EntityComponentStore.AssertCanAddComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@0.1.1-preview/Unity.Entities/EntityComponentStoreDebug.cs:232)
Unity.Entities.EntityManager.AddComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType, System.Boolean ignoreDuplicateAdd) (at Library/PackageCache/com.unity.entities@0.1.1-preview/Unity.Entities/EntityManagerChangeArchetype.cs:697)
Unity.Entities.EntityManager.AddComponentData[T] (Unity.Entities.Entity entity, T componentData) (at Library/PackageCache/com.unity.entities@0.1.1-preview/Unity.Entities/EntityManagerChangeArchetype.cs:404)
SpawnPhysics.CreateBody (Unity.Rendering.RenderMesh displayMesh, Unity.Mathematics.float3 position, Unity.Mathematics.quaternion orientation, Unity.Entities.BlobAssetReference`1[T] collider, Unity.Mathematics.float3 linearVelocity, Unity.Mathematics.float3 angularVelocity, System.Single mass, System.Boolean isDynamic) (at Assets/_Scripts/ECS/SpawnPhysics.cs:55)
SpawnPhysics.Start () (at Assets/_Scripts/ECS/SpawnPhysics.cs:30)