FGear Vehicle Physics (v1.4)

traction assist could be used for slow moving offroad vehicles, not useful for your case.

you want to activate this assist in a specific case which involves finding whether the vehicle is rotating due to inertia. that sounds difficult since any external force could cause a rotational velocity. you could try activating while rotational velocity and your steering direction are in opposite directions and also you can take understeering(check updateESP function to see how it can be detected) into account. if you are not understeering then this effect may result unwanted wild steers. you can use lateral/longitudinal slip values instead of using car speed, they are calculated from local velocity vectors. finally look out for multiple assists activating at the same time, they can generate forces eliminating each other and/or generate chaotic results.

This mostly works, at least is a start. I need to find a better variable to get the angular velocity / rotation force to one side… dont know what can be the best.

float mAngularVel = FMath::Abs(mBody->GetUnrealWorldAngularVelocityInRadians().Z * 100.0f);

	if ( mHasContact && mAccel > 0.0f && mAngularVel > 100.0f)
	{	
	 mLngScale = FMath::Lerp(mLngScale, 4.0f, 0.01f);
    }	
	else { mLngScale = FMath::Lerp(mLngScale, 3.0f, 0.05f);}

The bug is when the car not rotates( mostly stopped) but clearly have forces to that direction, but is something. Any idea to test?. Also still i need to add the mCurrentSteer condition to limit more to the case i want.

Edit: With the steer case:

float mAngularVel = FMath::Abs(mBody->GetUnrealWorldAngularVelocityInRadians().Z * 100.0f);

	if ( mHasContact && mAccel > 0.0f && mAngularVel > 100.0f)
	{	
       if ( mCurrentSteer > 0.0f && mBody->GetUnrealWorldAngularVelocityInRadians().Z < 0.0f ||
	        mCurrentSteer < 0.0f && mBody->GetUnrealWorldAngularVelocityInRadians().Z > 0.0f)
		{
	      mLngScale = FMath::Lerp(mLngScale, 4.0f, 0.01f);
	    }
	 
    }	
	else { mLngScale = FMath::Lerp(mLngScale, 3.0f, 0.05f);}

So if angular is negative and steer is positve or opposite then give the extra force to steer. Is not 100% but getting closer.

even if the vehicle is not moving tires always generate forces, it’s how the simulation works, there is no sleep mode, so you need to filter those when the vehicle is stationary or slow.

Any idea on UE5 release? (do you have a download for the current test version)

Well, finally found a way that works for my case, just need to do some value tweaks.

	if ( mHasContact && mAccel > 0.0f && mLocalVelocity.X > 0.0f && mLateralForce.Size() > 5000.0f)
	{	
       if ( mCurrentSteer > 0.0f && mLatFrictionForce > 5000.0f ||
	        mCurrentSteer < 0.0f && mLatFrictionForce < -5000.0f )
		{
			mLatFrictionForce = mLatFrictionForce * 0.1f;
			mLngScale = FMath::Lerp(mLngScale, 6.0f, 0.02f);
	    }
    }	
	
	else { mLngScale = FMath::Lerp(mLngScale, 3.0f, 0.05f); }

Now i can do this in a more easy way and better car direction control when slide:

Also i set steer gravity to 10 and their range to 100 for more precision, and edited the StandardInput steer with this:
mSteerInput = FMath::Clamp(mSteerInput * FMath::Abs(mHorizontal * 1.2f) , -mCurrentSteeringLimit, mCurrentSteeringLimit);

That (mHorizontal * 1.2f) takes the stick position too on steer, so it adds much more precision at any speed that only using the steer speed/limit curves in the editor.

1 Like

ue5 support is not possible without actual ue5 release.
if you want to test it yourself, you can compile it with ue5 with some minor code changes.

do you have the code changes required by anychance.

drop a mail to lazybitgames@gmail.com

4.27 just released, any date about Fgear compatibility?

probably next week, v1.5 is also on the way…

Great! Any advance about the 1.5 features? Improved physics? Maybe volumetric wheels collider?

no volumetric wheels yet, we tested convex(cylinder) casting successfully with the unity version so it will most likely be available for the unreal version too. full change list will be posted with the release.

I see, great news, every improvement is welcomed :slight_smile:

hi, i have bad news.

the main feature of the new version is the convex casting option. i completed the new unity version and started porting the features to unreal but it seems that there is no way to cast a convex shape with unreal. they simply haven’t implemented that part yet. someone asked about it 5 years ago and it’s still not there. the only way is to modify the source of the engine but it’s not a valid option for us.

so the next update is on hold right now…

I see, so, no more updates until Epic fixes the issue? Because i guess you already tried some workarounds or had in mind release without that but if still is gonna be hold is due that feature is important to other updates i guess.

Any idea about if Chaos on UE5 supports convex shape ?

i do not believe epic will ever fix that, i have one more idea to try but it requires some fundamental changes so next update is on hold for now. chaos is not an option until it becomes the default physics engine.

4.27 support is available now.

1 Like

Excellent, Thanks for all your support, endless as always. I do hope you have success with the next V1.5 also soon

Great! so, no updates just compatible now with 4.27 right?

I saw in the website now in 3D wheels appears “convex shape” but i guess is just for unity right? It not appears the “*” to say is only in unity but due you said, or the workaround idea worked ?

no, i assumed i could do the same stuff in unreal but it’s lacking some api. workaround is under research…