Hello, I just got the new version of the package, are there samples on how to use it inside BURST/ECS?
I have found the follower entity script, and copied the components from there:
ecb.AddComponent(entity, this.movement);
autoRepathBacking.Reset();
ecb.AddComponent(entity, autoRepathBacking);
ecb.AddComponent(entity, new MovementControl() { });
ecb.AddComponent(entity, managedState);
ecb.AddComponent(entity, new SearchState() { });
ecb.AddComponent(entity, new MovementStatistics()
{
lastPosition = pos,
estimatedVelocity = float3.zero,
});
ecb.AddComponent(entity, this.shape);
ecb.AddComponent(entity, new ResolvedMovement());
ecb.AddComponent(entity, new DestinationPoint
{
destination = new float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity),
});
ecb.AddComponent(entity, new AgentMovementPlane(this.transform.rotation));
ecb.AddComponent<SimulateMovement>(entity);
ecb.AddComponent<SimulateMovementRepair>(entity);
ecb.AddComponent<SimulateMovementControl>(entity);
ecb.AddComponent<SimulateMovementFinalize>(entity);
ecb.AddComponent<SyncPositionWithTransform>(entity);
ecb.AddComponent<SyncRotationWithTransform>(entity);
ecb.AddSharedComponent(entity, new AgentMovementPlaneSource { value = movementPlaneSourceBacking });
if (managedState.enableGravity)
ecb.AddComponent(entity, new GravityState() { });
if (!managedState.pathTracer.isCreated)
{
managedState.pathTracer = new PathTracer(Allocator.Persistent);
}
But when I make the SetPosition to any value, the entity does not move at all, and I cant seem to figure out what exactly I am doing wrong. The debug gizmos show the correct path, but there is no movement. I tried adding the SyncTransform , even though I am not using GO on this entity. But to no avail.
EDIT: So for some reason is SCALE is set to 0 in LocalTransform (or something that not one) the entity does not move… changing it to one does fix it, looks like. Havent figured out why yet though…