[1.0.0-prev.15] Setting Physics velocity is not applied to WorldTransform

I just upgraded to the latest iteration (15) and my previous systems don’t seem to work the same way anymore.

When I am setting the target velocity in the following way:

    var targetVelocity = PhysicsVelocity.CalculateVelocityToTarget(
                        SystemAPI.GetComponent<PhysicsMass>(entity),
                        translation, rotation,
                        target, 1 / deltaTime);
                    velocity = targetVelocity;

The LocalTransform component values go to very high values, so does the PhysicsVelocity, but the WorldPosition doesn’t update.

The system runs in the PredictedFixedStepSimulationSystemGroup and it worked normally in the previous iterations (before the Transform System V2).

Now I’m not sure if that might be a bug due to the new transform system, or me missing some setup to make it work properly.

1 Like

The WorldPosition is updated only after the TransformSystemGroup run. Before V2, the world position was always calculated on the fly.
Now it is a cached property and does not get updated automatically as expected. This is mostly a well known problem in general.

I would thanks you for reporting this, since it also add to the cases that need to be addressed by the new transform system.

2 Likes

Seen as in the latest release WorldPosition has been deprecated in favor of a faster TransformV2, this is no longer valid.