PhysicsComponent.UpdatePhysicsTransformation() adds extra offset to physics debug model
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 3.0.0.8 / 3.1.0.1-beta01-0441
Platform(s): Windows
Describe the bug
PhysicsComponent.UpdatePhysicsTransformation() adds extra offset to physics debug model when ColliderShape.LocalOffset is not 0.
That seems not to happen when a StaticColliderComponent gets CompoundColliderShape.
To Reproduce
Steps to reproduce the behavior:
- Create new game project.
- Add a StaticColliderComponent to the Sphere entity and add a sphere collider to it.
- Set the sphere collider's LocalOffset to X=1 Y=0 Z=0.
- Add a SyncScript like this.
public class TestScript : SyncScript
{
public override void Start()
{
}
public override void Update()
{
DebugText.Print(
$"Sphere: {Entity.Transform.WorldMatrix.TranslationVector.ToString()}" + Environment.NewLine +
$"Sphere Collider: {Entity.Get<StaticColliderComponent>().PhysicsWorldTransform.TranslationVector.ToString()}" + Environment.NewLine +
$"Debug Entity: {Entity.Get<StaticColliderComponent>().DebugEntity?.Transform.WorldMatrix.TranslationVector.ToString()}" + Environment.NewLine +
$"Debug Entity Child: {Entity.Get<StaticColliderComponent>().DebugEntity?.GetChild(0)?.Transform.WorldMatrix.TranslationVector.ToString()}",
new Int2(10));
if (Input.IsKeyPressed(Keys.Space))
{
Entity.Get<StaticColliderComponent>().UpdatePhysicsTransformation();
}
}
}
- Add it to the Sphere entity.
- Add DebugPhysicsShapes asset and add it to the Sphere entity.
- Run the game.
- Press Ctrl + Shift + P keys.
- Press space key.
Expected behavior
Nothing happens when you press space key.
Screenshots
Step 8.

Step 9.

Log and callstacks
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at StaticColliderComponent.UpdatePhysicsTransformation() and trace how ColliderShape.LocalOffset is applied to the physics debug model, comparing the regular sphere collider with CompoundColliderShape behavior. Reproduce the issue using DebugPhysicsShapes and the supplied SyncScript, then verify that pressing Space no longer moves the debug model when the local offset is nonzero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100