FGear Vehicle Physics (v1.4)

quoting from documentation:

Steer Sensitivity : This value is only used when the controller is a wheel. This determines how fast the steering value catches up with the input axis value. Higher values result sharper steering.

so it won’t effect keyboard or controller, modify steer speed curve instead.

How to make the steer limit faster? , my car turns very fast despite having low sensitivity

lower sensitivity means slower steering, higher sensitivity means faster steering…

you just need to tune the “steer speed curve” of the standard input.

you can observe the steering rate and angle values through telemetry like below:

Hello, does anyone else feel that their vehicle handling behaves differently when someone adds objects, models to the vehicle? Why did something like this happen to you in mine? because it imports a complete vehicle and it feels as it should, but when adding objects and some models it starts to move badly, very arcade-like

What do you mean by adding objects?

If you mean adding Static Meshes to the vehicle BP, then you may want to disable any options for each static you have added such as Mass/Collision/Physics etc. so that way they are only visual elements.

Hi, I need to ask a few more questions:

My vehicle has open wheels and the entire traction, suspension and steering mechanism is visually exposed, so the movement animations will be done through blendspace, and to guide these animations I need some variables that I don’t know if they are exposed in your plugin.
The variables are:
The normalized travel position of each suspension or a local normalized wheel Z position.
The local rotation of each wheel on the Y axis (spin) and the local rotation of the kingpin (to turn the wheels, I saw in an old post here that there is a function called getNormalizedSteering, if it is exposed in BP, I believe that is enough ).
(Other plugins and the Unreal vehicle itself use a combined rotation (spin and turn) for the front wheels, making them turn on their own axis, I need these separate rotations because of the distance between the kingpin and the wheel.)

Another question is that the vehicle has a double wishbone suspension, which causes the wheel to move laterally according to the movement of the suspension. Is it possible to manipulate the position of the physical wheels at runtime?

Regarding multiple raytracing, is it possible to vary the angle between them or is it something fixed? For performance, I would like to have fewer rays spread out at a larger angle.
The beginning of this video exemplifies it well: https://www.youtube.com/watch?v=nxH6LNCgqU4

Can the sounds and effects contained in the plugin example project be used in commercial projects?

Thanks

For the first part of your steering, I believe you just need to transform of the wheels to pass to your animBP. I have a similar set up in which, the chassis is a sub skeletal mesh on the vehicle. In the animBP of the chassis skeletal mesh, I do a get owner, cast to Fgear vehicle, get the mmesh, get animinstance, cast to Fgear animinstance, promote to variable. I then promote the axles transform to variables on tick which I then use to transform the hub, suspension and control arms in the animgraph. The second part of your question, yes get normalized steering angle is exposed to BP and it works nicely for steering rotation. For changing the number of rays, I’m not sure you can change it at runtime. But I think you can set it in the defaults panel. Also you can switch between raycast and convex at runtime but remember to use the apply wheel options node afterwards

Thank you gurusaint, very clever solution, but I’m developing for mobile platform and if I had direct access to the variables it would be better in terms of performance.

I saw through the documentation that it is possible to get the wheel transformation values ​​through the “GetAxles” node within AnimBP, but I fear that these values ​​do not come in local space and the rotation of the front wheels is mixed between Spin and turn, which would be useless in my case .

Can these variables that are displayed in telemetry be accessed by BP?


I could use “Speed” to spin the wheels, “SteerAngle” to correctly turn the kingpins and “RideHeight” to adjust the suspension.

Are you sure it is possible to space the rays? In the documentation, only the “Ray Count” and “Lateral Ray Count” options appear.

I believe all the telemetric variables are exposed to BP. Also you can get the axles and change the transformed space in the “transform bone” node in the animBP.

It should work well with the rear wheels, but with the front wheels it’s another matter, if I tried to isolate just Y (in local or world space) I would get incorrect values. Since Z also moves, Y and X need to change values ​​to maintain the effect of the wheel turning and spinning at the same time. In the end, using just the Y value, the wheel animation would spin in random directions. If I used Z for the Kingpin, it would also give me the same problem.

In any case, I need to be sure about all those previous doubts before making the purchase. (I’m not saying that the plugin isn’t worth this amount, but that it’s an expensive investment for an indie developer).

Q1
for wheel transform you can call:

wheel.getCurrentSteer (degrees)
wheel.getPitch (radians)
axle.getCamberAngle (degrees)
axle.getToeAngle (degrees)

so
rotation X = ±axle.getCamberAngle
rotation.Y = wheel.getPitch
rotation.Z = wheel.getCurrentSteer ± axle.getToeAngle

it is currently not possible to get the final location of the wheels directly if you won’t use the anim bp approach but the calculation of the final spot can be implemented in bp since all the necessary data is accessible in BP. what you need to do is to implement a bp function that does the same calculation in UFGearWheel::visualsUpdate function (wheelPos vector). we’re gonna add this function in the next update…

Q2
you can move physical wheels in Y axis:

try wheel.setLateralOffsets(float spacer, float rim)

Q3
you can set the number of rays and they’ll be evenly distributed (I recommend using a cylinder cast instead)

here is how 5 rays look like:

Q4
yes

Thank you very much for the clarifications.
I will make the purchase as soon as the dollar stabilizes here. (Even with the fear that support for UE4 may cease, I believe that with the resources already available I will be able to finish the project)

Regarding Q3, I was confused, is the cylinder cast more performant than the multi line trace? My original idea was: Single line trace at high speed, multi line trace or sphere trace at moderate speed and cylinder cast at low speed.

Another thing I forgot to ask, can I change the pivot of the physical wheel? This would make the rotation of the wheel in relation to the kingpin more correct, otherwise, if it rotates on its own axis, it would make a considerable difference in relation to the visible wheel.

unreal4 support will continue…

depends on the number of rays, many rays would cost more then cylinder, few rays would cost less…

you can’t change the pivot of the physical wheel and the suspension system moves along a straight line. even if it is possible to move the wheel horizontally you may not be able to get physically accurate movement of a double wishbone suspension. you either need to implement that feature yourself or you need to fake the suspension movement like the RC car in the sandbox demo.

It’s great to know that UE4 support will be maintained.

Sorry to insist on this subject, but it is vitally important for the project:

With approximately how many rays is it worth changing to the sphere and approximately how many rays is it better to change for the cylinder?

As I am going to use the cylinder at very low speed, if I use a cylinder with very few polygons will this increase performance? I imagine that the cylinder with more polygons is to prevent the vehicle from bumping at high speed, right?

can’t give a number, sphere cast is pretty cheap, convex cast depends on poly count but you can’t go too high anyway.

the casted cylinder is not rotated with the wheel so even if you use a wedge like shape instead of a cylinder it wouldn’t result “bumping at high speed”.

Finally, plugin purchased!

I was able to perfectly animate the suspension (and consequently the wheel height) just with “Get Suspension Compress Ratio”, which provides the normalized suspension position.
On the front wheels, as you instructed, I used “Get Pitch” to spin the wheels and “Get Current Steer” to turn the kingpin.

Still about changing the pivot of the physical wheel, I tested the “Set Lateral Offsets” and it worked well at runtime, wouldn’t it be possible to do the same in X?
This way I could draw a correction curve and update the position of the wheel correctly according to the steering (without touching Z). (Of course, this function would only occur at low speeds, where correct wheel positioning is most necessary)

Let say I have a truck (which has 250hz physics)… and this truck is connected via physicsconstraint to a trailer (which has 60hz - ‘normal’ physics).
Does this setup going to have a problem?

we can add a forward offset in the next update.

if they do not have any problems when they’re not connected then it should be ok.
afair the truck and the trailer in the sandbox2 map have different update rates and it works fine.

Great, thanks!