var vel = rigidBody.GetRelativePointVelocity(wheel_fr.localPosition);
var tempvector = wheel_fr.right*-wheel_fr.InverseTransformDirection(vel).x;
rigidBody.AddForceAtPosition(hitnormal_rspring_strengthhitlength_r+hitnormal_rhitdelta_r + tempvector500 ,ray_origin_r,ForceMode.Force);
vel = rigidBody.GetRelativePointVelocity(wheel_fl.localPosition);
tempvector = wheel_fl.right*wheel_fl.InverseTransformDirection(vel).x;
rigidBody.AddForceAtPosition(hitnormal_l*spring_strength*hitlength_l+hitnormal_l*hitdelta_l + tempvector*500 ,ray_origin_l,ForceMode.Force);
So what I’m working on is a car game with ray cast suspension. The car itself is a rigidbody with offset force application for each wheel. I got the suspension done nicely but i can’t get the lateral grip to work properly. Essentially what I need is to read the velocity of the main car rigidbody but in the position and axis of the child/wheel. For some reason InverseTransformDirection doesn’t do it for me even though alot of my google searches have led me to this function.
I’m lost. Any help appreciated! Thanks in advance