Physic cube movement

Hello @Cedric
Moves forward when w is pressed. But when it turns it doesn’t go to the side where the cube turns. How can I do this? When the cube spins, go to the side where the cube turns

When w is pressed go to the red side of the cube

Hi @3dObject

I didn’t see any usage of physics joints in your code. Did I miss it?
You need joints between the chassis and the wheels. Then, you can apply local forces on the wheels.

Joints | Babylon.js Documentation

Check more particularly the hinge motor samples.

1 Like

actually i don’t know cannon integration with babylon physics
https://schteppe.github.io/cannon.js/demos/raycastVehicle.html

how should I do this babylon js react js too

You can check this sample with cannon : https://www.babylonjs-playground.com/#UGMIH#15

Hello @Cedric
I am having a problem here
why is this happening

can you please help

Hi @3dObject

Can you please be more specific. I only see a sphere above the terrain and a falling box.

Hi @Cedric
sorry for the late response
I could not solve this problem
https://www.babylonjs-playground.com/#UGMIH#17