FGear Vehicle Physics (v1.4)

Did you backup the old plugin?
If so, you could use it to remove the discontinued node and then update the plugin again.

Unfortunately, I don’t have a backup of the plugin for 5.3

I guess one of your project dll is trying to access a function that no longer exists.
is this a BP only project, could you have overridden the “Destroyed” function of the vehicle.
going back to the older plugin and checking that is a good idea, if you do not have backup, drop a mail with your unreal version and I can provide a link.

setting mEnableTireSmoke would work or you can edit the if case like this:

if (mEnableTireSmoke && cs && physicalMaterial->mSmokeParticle != nullptr && !mVehicle->getIsSleeping())

Thanks, I’ll try with the “if”, because thinking even better now, if I change the variable, when the car wakes up the effect will be activated even if I had disabled it previously.

These were the changes, before compiling, can you please tell me if there is something wrong or am I forgetting something?

FGearEffects.h

UFUNCTION(BlueprintCallable, Category = FGear)
void setEnableTireSmoke(bool e) { mEnableTireSmoke = e; }
UFUNCTION(BlueprintCallable, Category = FGear)
bool getEnableTireSmoke() const { return mEnableTireSmoke; }

FGearEffects.cpp

//if (mEnableTireSmoke && cs && physicalMaterial->mSmokeParticle != nullptr)
if (mEnableTireSmoke && cs && physicalMaterial->mSmokeParticle != nullptr && !mVehicle->getIsSleeping())

//if (mStopEffectsWhenSleeping)
//{
//	if (mSkidSoundComponent && mSkidSoundComponent->bIsPaused) mSkidSoundComponent->SetPaused(false);
//	for (int i = 0; i < mSmokes.Num(); i++)
//	{
//		if (mSmokes[i]) mSmokes[i]->SetVisibility(true);
//	}
//}

//if (mSmokes[i]) mSmokes[i]->SetVisibility(false);
if (mSmokes[i]) mSmokes[i]->Deactivate();

I successfully rebuilt the project. It now works. Thanks guys

2 Likes

if (mStopEffectsWhenSleeping)
{
if (mSkidSoundComponent && mSkidSoundComponent->IsPlaying()) mSkidSoundComponent->SetPaused(true);
//for (int i = 0; i < mSmokes.Num(); i++)
//{
// if (mSmokes[i]) mSmokes[i]->SetVisibility(false);
//}
}

if you want to pause the skidding sound effect leave that one, if not you can comment it all.
you don’t need to call deactivate here since it will be called whenever the vehicles goes to sleep.

It worked perfectly, Thanks!

Disregard one of my suggestions for the effects “A variable to determine when the wheel effects will start.” I saw that it is possible to adjust this using the variables already exposed: “Long Slip Threshold” and “Lat Slip Threshold”.

hello @lazybitgames When I use their preconfigured cars, at high speeds on highways they do not lose control, but when I use my own cars they all lose control at high speeds, what suggestion can you give me? They basically have the same physics configuration and physical model of the car.

can’t say much, could be due to multiple reasons.

maybe you forgot to set tire models, in such cases a default simple tire is created but that model is not much stable. anyway if you mail your vehicles save file I can take a look.

How can I simulate sand with FGearPhysicalMaterial?
I lowered the friction and increased the roughness, but the vehicle slides as if it were on ice.

you can’t.

FGearPhysicalMaterial only implements friction, roughness has no effect(stated in the documentation).

you can do some custom stuff like detect that the wheel is on sand and apply some artificial force against the movement of the vehicle.

This is pretty bad, simulating the type of terrain would be a basic thing to expect from a vehicle physics system. Do you have any intention of implementing this in a reasonable time frame, or at least making it compatible with Unreal’s standard physics material?

when it comes to extra features we do not promise anything, they’re just demonstrations, this is the case since the beginning.

you can request a refund, we are open to it.

This is not an “extra”, this is a core functionality for a physics system, it’s something basic in Unreal standard physics, what is expected from a plugin is that it improves, not worsens or removes something that already exists.

Think better about the completeness and reliability of your product before being adamant and offering just a refund, my project is already completely dependent on your plugin.

what is that core functionality in unreal physics, can you define it, I’m not aware of that.

I doubt that what you want and what you define as “core functionality” are not the same thing.

afaik there is no physics setting that can simulate a wheel in mud or sand.

if you want a wheel to have a drag effect then you can imitate the behavior somehow, gave you a hint earlier and it is pretty simple to implement. if you are not willing to do simple stuff then you’ll have hard time making games.

In my original project I had already simulated the types of terrain I needed using the standard vehicle and physical material in Unreal (dirt, sand, asphalt), basically adjusting Friction / Static Friction / Friction Combine Mode. Although, the values ​​of my “Tire Lat Stiff” of the “wheel BP” were very high, also the physical materials of my “Tire Config” had more friction, so I probably wouldn’t be able to simulate ice (which is not useful to the project).
Maybe if I increase the corresponding values ​​in your plugin, I can achieve a similar result.
Anyway, I’m sorry for being harsh, every question or suggestion I leave here is with the aim of improving your product and not the other way around.

it is not just the tire friction that affect the vehicle on sand, you can’t achieve a slow down by playing with friction values.
you need to imitate the counter force generated by the sunk wheels, here is a quick attempt:

As you said, changing the parameters made no difference on a slippery surface.
What I was trying to do, following your first suggestion, was to apply a counterforce to each wheel that came into contact with the sand surface. I used a line trace to identify the surface and then calculated the counter force according to the speed of the wheel (Lat/Long), in addition to calculating the compensations if 4WD and Diff Lock were activated.
But in the end it was a bit heavy/inconsistent (on the Android device), perhaps because it is a timer with a for loop in BP.

The only solution I have found so far in terms of performance, was to calculate only in relation to the vehicle, and also to stop distinguishing between lat/Long speeds. It’s far from perfect, and I need to find the correct values, but the sensation of slowing down when entering the terrain, maintaining momentum, loss of traction at low speed, etc. is already noticeable.

Your example looks great.
Is your solution lighter? Can you show me how to implement it?