# Understanding the physics of teleporting bodies

**URL:** <https://forum.babylonjs.com/t/understanding-the-physics-of-teleporting-bodies/61234>\
**Category:** Questions\
**Tags:** physics, havok\
**Created:** [October 31, 2025, 10:44am UTC](https://forum.babylonjs.com/t/understanding-the-physics-of-teleporting-bodies/61234 "2025-10-31T10:44:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [October 31, 2025, 10:44am UTC](https://forum.babylonjs.com/t/understanding-the-physics-of-teleporting-bodies/61234/1 "2025-10-31T10:44:52Z")

</div>

Hey there,

I am tinkering with teleporting objects while applying forces to them (my use case is recentering the physics scene when the objects are far from the origin so I avoid the 32bit imprecision of Havok calculations)

I think there is a bunch of stuff I don’t really understand as shown in this PG:

> **[Babylon.js Playground](https://playground.babylonjs.com/#Z8HTUN%231308)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

Basically, the cube is moving through space and I will teleport it back to the origin when it gets too far.

The issue happens on the frame where the teleportation happens: the object position changes suddenly and I need `disablePreStep=false` to make sure Havok acknowledges the change.

Using “Option 2”, I then apply my forces (thrust and gravity) on the object at its new position (here, teleported to the origin) but the object starts spinning. This makes me believe havok applies the force far from the object center, hence creating the rotation. I don’t understand why this happen since I updated the position of the object and used `disablePreStep=false`

What puzzles me even more is the fact “Option 1” does not have the same problem: we apply the force on the outdated object position (not teleported), then we teleport the object (and I expect Havok to work with the teleported position with `disablePreStep=false`). This should create a sync issue and some angular momentum, but instead everything seems to be working fine.

I am ok with using Option 1 since it works, but I would really like to understand why this is happening at all 🤔

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [October 31, 2025, 4:00pm UTC](https://forum.babylonjs.com/t/understanding-the-physics-of-teleporting-bodies/61234/2 "2025-10-31T16:00:22Z")

</div>

cc @Cedric

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [October 31, 2025, 4:44pm UTC](https://forum.babylonjs.com/t/understanding-the-physics-of-teleporting-bodies/61234/3 "2025-10-31T16:44:45Z")

</div>

Some elements to understand it:

`getObjectCenterWorld` returns a copy of the transformNode.position. Without querying Havok physics state.

Physics has to tick to commit the transform node change to Havok.

Force is applied at (0,0,0) and that force command is buffered by Havok.

And there is the `if`. case 1, position is far away. case 2, position has been set to 0.

I don’t have the full picture in mind but you are right with the position the force is applied to. With that frame delay, it’s not in sync with transform node and a torque is induced.

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [November 1, 2025, 10:48am UTC](https://forum.babylonjs.com/t/understanding-the-physics-of-teleporting-bodies/61234/4 "2025-11-01T10:48:43Z")

</div>

Thanks for the answer!

So if I understand correctly, `applyForce` calls will be sent to Havok (through `HP_Body_ApplyImpulse`) which has the not-yet-teleported transform to update the linear and angular velocities. For those velocity updates to make sense, I need to send the not-yet-teleported point of contact for the force.

Then during the physics tick, the havok transform is updated with the teleportation and applies the previously computed velocities to the body.

I think my confusion stemmed from believing `applyForce` would simply register the force for application during the physics tick, which in the end is not true since Havok seems to update the velocities right away, which explains why I must use the not-yet-teleported center of the object.
