# Resetting Mesh to original position after physics are applied (with Havok)

**URL:** <https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070>\
**Category:** Questions\
**Created:** [July 1, 2023, 12:17am UTC](https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070 "2023-07-01T00:17:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [July 1, 2023, 12:17am UTC](https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070/1 "2023-07-01T00:17:45Z")

</div>

Hi - i used to reset objects to their starting points by keeping track of the initial position - and then removing the imposters and resetting the mesh to that position. But that technique is not working any more with havok. Seems like i’ll need to un-bind the mesh from the body somehow?

Here’s a PG - what should the ResetBoxes() function do?

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

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [July 1, 2023, 5:59am UTC](https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070/2 "2023-07-01T05:59:59Z")

</div>

When i try to dispose of the body, i get:  
Syncing transform failed for node custom: Cannot read properties of null (reading ‘hpBodyId’)…

---

<div class="post-metadata">

**Author:** ![qq2315137135](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qq2315137135/32/32219_2.png) [@qq2315137135](https://forum.babylonjs.com/u/qq2315137135)\
**Post date:** [July 1, 2023, 7:59am UTC](https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070/3 "2023-07-01T07:59:38Z")

</div>

Now you need to set

```auto
mesh.physicsBody.disablePreStep = false

```

before you can set the position of the physics body

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

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [July 1, 2023, 2:30pm UTC](https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070/4 "2023-07-01T14:30:48Z")

</div>

Thanks that’s useful. I’m looking more for a way to reset by removing the body/shape from the mesh. I was thinking i could just dispose of it.

`mesh.physicsBody.dispose();`

That does actually work to reset, but it also throws a ton of unending info-warnings and also leaves the shape un-disposed:

`Syncing transform failed for node custom: Cannot read properties of null (reading 'hpBodyId')`

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

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 3, 2023, 12:37pm UTC](https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070/5 "2023-07-03T12:37:41Z")

</div>

You have to remove the body from the viewer also: [PhysicsV2 Add Bodies - reset | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#RQIZD3#16)

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [July 3, 2023, 2:01pm UTC](https://forum.babylonjs.com/t/resetting-mesh-to-original-position-after-physics-are-applied-with-havok/42070/6 "2023-07-03T14:01:35Z")

</div>

Aha!  
Thx so much.
