# Havok - get/set the position

**URL:** <https://forum.babylonjs.com/t/havok-get-set-the-position/51340>\
**Category:** Questions\
**Created:** [June 15, 2024, 7:21am UTC](https://forum.babylonjs.com/t/havok-get-set-the-position/51340 "2024-06-15T07:21:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodingCrusader](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/codingcrusader/32/29857_2.png) [@CodingCrusader](https://forum.babylonjs.com/u/CodingCrusader)\
**Post date:** [June 15, 2024, 7:21am UTC](https://forum.babylonjs.com/t/havok-get-set-the-position/51340/1 "2024-06-15T07:21:38Z")

</div>

How can I set the position?

On my machine, I can’t pass very many objects to the Physics Engine. The CPU falls to its knees under the load and the animation becomes slow.

I had the idea of using the physics engine in places where the objects are more visible and should be animated more often.

So I just have a set of agg.bodies that get their position and linear acceleration in the interval, work with it for a while and return the position and acceleration.

I am currently failing with the repositioning.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/b/9bf8b3250674b8ff0779bb4991e8044a15fefa75.png)

transformNode.position an spheres[i].position don’t give back the current position and getAbsolutePosition is not correct.

The idea to hang the mesh with parent = sphere[i] is not a good idea, too.

Can someone give me a hand?

[Experiment : relative use of physics | Babylon.js Playground (babylonjs-playground.com)](https://www.babylonjs-playground.com/#C8I4X9)

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [June 15, 2024, 8:29am UTC](https://forum.babylonjs.com/t/havok-get-set-the-position/51340/2 "2024-06-15T08:29:08Z")

</div>

I am not sure what is supposed to happen exactly but check this out: [https://www.babylonjs-playground.com/#C8I4X9#1](https://www.babylonjs-playground.com/#C8I4X9#1)

disable disablePrestep on the physics body right before you want to change a transform on the transformNode. If it is a one time assignment, enable it again in the next frame or so (performance).

---

<div class="post-metadata">

**Author:** ![Joseph\_Daniels](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joseph_daniels/32/40244_2.png) [@Joseph\_Daniels](https://forum.babylonjs.com/u/Joseph_Daniels)\
**Post date:** [June 15, 2024, 11:37am UTC](https://forum.babylonjs.com/t/havok-get-set-the-position/51340/3 "2024-06-15T11:37:01Z")

</div>

did not see any problems.  
collisions are in equal time.  
if you want to predict, use quadratic formula.

---

<div class="post-metadata">

**Author:** ![CodingCrusader](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/codingcrusader/32/29857_2.png) [@CodingCrusader](https://forum.babylonjs.com/u/CodingCrusader)\
**Post date:** [June 16, 2024, 7:14am UTC](https://forum.babylonjs.com/t/havok-get-set-the-position/51340/4 "2024-06-16T07:14:27Z")

</div>

almost right now.

[Experiment : relative use of physics | Babylon.js Playground (babylonjs-playground.com)](https://www.babylonjs-playground.com/#C8I4X9#2)

but whether the idea is really useful is another matter … 😕
