If you never tried, this means update the inertia XY or Z at runtime maybe is not a good idea?
Don’t know how to get it working, i checked the FGearVehicle.cpp and there is a:
“void AFGearVehicle::setInertiaScale(FVector iscale) {”.
But dont know what to do inside the FgearWheel to set only the Z one for my case.
There is a “//store local inertia tensor matrix” - “mLocalIIT.M[2][2] = 1.0f / inertia.Z;”
But i guess this is from the physics one, i dont want to change the Z tensor on the physics, just the InertiaScale from Z on the Fgear BP.
This is the actual condition im working:
if ( mHasContact && mAccel > 0.0f && mLocalVelocity.X > 0.0f && mLateralForce.Size() > 1000.0f )
{
if ( mCurrentSteer > 0.0f && mLatFrictionForce > 1000.0f || // Left to Right
mCurrentSteer < 0.0f && mLatFrictionForce < -1000.0f ) // Right to left
{
// Higher *X works as normal. With lower it decreased the lateral force
//mLatFrictionForce = mLatFrictionForce * 0.5f; // Allows stop the car rotation for better aim on curves // Basic
//mLatFrictionForce = FMath::Lerp(mLatFrictionForce * 0.5f, mLatFrictionForce, 0.01f); // With lerp
mLatFrictionForce = FMath::Lerp(mLatFrictionForce * (mCurrentSteer/35.0f), mLatFrictionForce, 0.01f); // Better steer & counterspeed
}
}
So, i want to add a formula using mCurrentSteer & InertiaScale Z to see if it combines well to get the overall steer/countersteer behaviour im looking.
Can you give me the working code to set the inertia scale inside FgearVehicle? If maybe is too complex i can pay for that.