private void SpawnWaypoint(Vector3 pos) { var newWaypoint = em.CreateEntity(Archetypes.waypointArchetype); em.SetComponentData(newWaypoint, new WaypointComponent { id = UniqueID.GenerateNewId(), position = new float3(pos.x, em.GetComponentData <Scale>(newWaypoint).Value, pos.z) } ); em.SetComponentData(newWaypoint, new Scale { Value = 1f } ); em.SetComponentData(newWaypoint, new Translation { Value = new float3(pos.x, em.GetComponentData <Scale>(newWaypoint).Value, pos.z) } ); em.SetSharedComponentData(newWaypoint, new RenderMesh { mesh = waypointMesh, material = waypointMaterial } ); }