how do i have multiple kinematic bodys interact

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By cole funk

so I’m trying to make a racing game and the built in car physics aren’t enough for me, it is missing camber, caster, toe, tire compound, tire wear, flexible tires, etc. anyway, i was wondering how i could simulate each tire, as in i want to know if it could be done with a for loop, or better/faster to do with running code on each tires node. also i want to know how i could use body lean to calculate the individual weight on each tire. and the only way i think i could do that is if i had a kinematic body for each of the tires and the body, but then i don’t know how i could make the body lean with the g-forces as the car turns/brakes/accelerates.

:bust_in_silhouette: Reply From: Magso

It would be easier to calculate this through variables like

weightOnFrontRight = weight + lean - acceleration
weightOnBackLeft = weight - lean + acceleration

ok, i’m sorry, i shouldn’t have gone off on a tangent. i was mainly asking how i can use joints to hook my wheels to the car body and have the car body roll.

cole funk | 2019-04-20 15:12

Try using a SliderJoint for each wheel.

Magso | 2019-04-20 19:19

thank you very much, but one last thing, is there anyway i could have the dampening on extension greater than on compression.

cole funk | 2019-04-21 01:40

You set a variable to the last y position local to the joint and check if the current y position is more or less than the variable, then set the damping for it. I don’t know how to set the damping though. The SpringJoint doc just says set_param(value) in every property :confused:

Magso | 2019-04-21 19:36