Havok car experiment

Hey folks!

I am starting a small car controller experiment with Havok based on this discussion Are motorized constraints still being introduced? - #10 by Octo8080X

I am not sure how far I want to take this, but there you go:

(controls are WASD or ZQSD)

Known limitations include not being able to turn while moving forward, but you have to start somewhere! :joy:

13 Likes

This is a great start! Can’t wait to see your progress here :slight_smile:

The vehicle always spawns at the center of the world. How can I change that? No matter what I try, either the position I specify is not adopted or overwritten by the physics, or the vehicle flies chaotically through the world after starting.

I didn’t think that setting the start position would be such a difficult. :sweat_smile:

I can change the new start position of the vehicle using chassis.position and adjust the position of the tires relative to the chassis. But when chassisAggregate.body.addConstraint(wheelAggregate.body, motor) is executed, the chassis object jumps to the center of the world, while the tires remain at the new start position.

I have been trying to understand and solve the problem for hours. But I just don’t understand anything. This behavior makes no sense to me. I have tried a lot of things but it just won’t work. Can’t anyone help me? :disappointed:

I’m really shocked at how something as trivial as an arbitrary starting point has become a challenge. Either something is wrong or I’m really stupid.

Good point it shouldn’t be that difficult! The issue is that designed each element independently and now if I move the chassis, the rest of the car does not with it move which create issues.

I think this car works better overhaul, you will probably have a better time with it:

It is really not your fault, this car is very much a prototype and I didn’t have the time to make more than the bare minimum work :confused:

1 Like

Another great car controller that works much better than this one:

1 Like

This is amazing! thank you for sharing!

1 Like

Thanks. I have now found the solution to my problem. You just have to add the following code:

backLeftWheel.parent = chassis;
backRightWheel.parent = chassis;
frontLeftWheel.parent = chassis;
frontRightWheel.parent = chassis;
1 Like