roughness wasn’t used until the very last update. with v1.8.1 roughness is used as a slow down factor, if the roughness is large the wheel on that material will experience a drag force which slows the vehicle down.
Decals not Casting onto vehicle.
WHELP!
Check if the primitive component has “receives decals”
Legend, Thanks.
Now if anyone could help with the smoke. That tire smoke wouldn’t go through car lol.
Thanks! that info will come handy.
I found a possibly bad behaviour. Tested in the last FGearExample too.
On “Engine” if you set “Engine Inertia” high, the car accel more slow, thats ok as description says. But if you steer the car left/right the car accel more fast ¿? in theory it should be same or less. In my example i set inertia to 9, the car accels like 1-2kmh per second, if i start to steer left-right fast thats goes like 10 or more per second. ¿?
I was feeling something wrong, so i tried to check values trying to set some extreme numbers to make the bad behaviour more evident and catched this. On fast steering left-right the car accel more fast ¿?.
noted.
my first guess is that this is due to the feedback rpm calculation in AFGearVehicle::getFeedbackWheelRPM, we take the fastest axle rpm to drive the engine.
Tested and i guess you’re right, did a quick change to see what happens:
if (finalRpm < FMath::Abs(crpm))
by
if (finalRpm > FMath::Abs(crpm))
The problem is fixed, but the car in idle, without any input, goes backwards, and if steer left/right goes more fast in reverse, so the problem seems is there as you mentioned.
Are the calculations correct?
I checked the cars and they use mostly the engine curve with max 9k torque. Some have the limit changed to 6k or similar and match with the calculations, but for the LimitRPM with 9k , calculation says max is 7985.
So, are calculations correct and i should set the limit RPM to max 8k? or 9k, 12k… will be fine?
the calculation is simple, check UFGearEngine::calculateMaxPower.
limit rpm is not the rpm at which the engine generates max power, it’s the rpm at which the limiter is triggered, in real life this is to protect the engine. also the transmission most likely won’t wait until limit rpm to gear up. so if your limit is 9k and max power rpm is 8k you are good.
on the other hand the real power output is not the same as the curve right now, we subtract the friction torque to get the final torque value. so if you increase friction torque you will the see the same max power value but in reality the power is reduced.
Im using “mVehicle->getSteerDeltaAngle(true)”, for a counter steer condition, but having some problems.
At some point, if you turn fast or spin, the sign goes to opposite, from -90 to 90,etc… even if the car is constantly turning to the same side always.
This breaks the condition and its applied in wrong scenarios.
Is there any way to fix that?
it’s not just about spinning direction, that function assumes the vehicle going forward, you should detect the case when the vehicle’s velocity is not aligned with the vehicles forward direction(you can use a dot product) and possibly invert the forward vector.
You mean something like what you did here?:
FVector velDir = mVehicle->getVelocityDir();
FVector dir = mVehicle->getForwardDir();
float sign = FGearUtility::Sign(FVector::CrossProduct(dir, velDir).Z);
I tried, better but still fails. I found adding this one to the condition helps:
float rollZ = FGearUtility::getWorldTransform(mBody).Rotator().Roll;
But still fails in a few frames, enough to make the car get stuck.
There is no other Rotation variable that already gives always the correct values? I tried mLocalVelocity.Y and other lateral stuff but all them fails in one or other scenario.
well you may not be able to get a result that works right away, find the failing spots and make adjustments as needed. you just need to debug the code to see what numbers are failing.
I realized the cars in the new SandBox 2 all them have the Mx/My/Mz Momentum Scale to 0.0.
But the original ones, Mx/Mz are 1.0, and for (My)Roll it can be from 0.2 to 1.0 in some cases.
I cant find any behaviour difference in Mx/Mz, but (My)Roll makes the car like more traction/friction.
Any reason for that change in new cars? or just to make more slide/drift?
if you read the documentation it says:
All tire models generate Fx, Fy and My. Mx and Mz are only generated by MF6.1 tire model.
there is no specific reason for their values, if you try a very large value for My you can observe that the vehicle will rear up.
How i get LateralFriction or LateralScale,etc… per axle?
Only get working this:
mAxle->getWheelOptions()->getLateralFriction();
mAxle->getWheelOptions()->getLongitudinalFriction();
Or if they are axle*wheel:
mVehicle->getAxle(0)->getLeftWheel()->getLateralSlip();
But when the get/set is only available for axle, im unable to find how ¿?
In blueprints i see how:
But via code, tried FrontWheelOptions, or WheelOptions0 or similar but nothing worked. Checked other .cpp but cant find any reference how i should do that. ¿?.
How do you make it so the fgear camera cant go through walls and has a collision
in the project settings there is a clip value. change that.
wheel options are per axle, shared between wheels.
after doing any modification, you should call Axle.applyWheelOptions function.
wheels also store local values too but they can’t be read from BP right now, you can only modify them per wheel like Wheel.setLatFriction, if you want to access them per wheel you need to add your own BlueprintCallable getter functions.