Rotating physics on a wrecking ball

Hello everyone,

I’m currently working on a racing game. At the moment I’m working on implementing obstacles and I’m stuck in a situation where my physics doesn’t seem to move along with the model. I’ve played around with different pivot point locations, but so far without success.

Does anyone know why the physics imposter doesn’t rotate along with the model?

I’ve reproduced the problem in the playground:
https://playground.babylonjs.com/#66PS52#57

GIF:

pinging @RaananW

Hi,

I’m not sure what you ate trying to implement, so would be great if you cab described exactly what you expect the playground to do.
Regarding your direct question, the reason it doesn’t rotate when you force a rotation every frame is that you use the euler rotation, which is disabled when using a quaternion. Try using the rotate function instead

Hi @RaananW ,

My goal of the playground was to make the moving wrecking ball physics interact with the cube, which is exactly what happened using rotate.

So thank you! Using the rotate function solved the problem :slight_smile:

1 Like