Controlling a Tanks individual Tracks in UE5

Hi,
i want to move a tank through my environment by controlling each of the tracks via one of the Thumbsticks on the controller and cant find a solution for this problem. It doesnt need to have suspension or anything, just forward and backward on each individual track (speed depending on how far the sticks are pushed).
Old physx vehicle had a wheel index to apply torque to which i think would have made this possible. But in the new Chaos Vehicle thats not possible anymore.

Hi did you ever come up with a solution to this problem?

Thanks in advance

Hi,
unfortunately i didnt get it to work with the Chaos Vehicle. That thing is still in beta and as i tried to get it to work too many bugs showed up.
Good thing is my Vehicle only needs to move really slow and has no suspension at all so i just made a Setup with adding Forces to my Pawn and now it works fine.
For the Track control i made a workaround in Blueprints adding force basically like this:
LeftStick - RightStick = RotationalForce
and
LeftStick + RightStick = LinearForce
and Apply both to the Vehicle.
So For example Left stick at +1 and right at -1 will give a +2 Rotational and 0 Forward Force and it spins in place.
Left Stick at +1 and right at 0 will give a slight turn at +1 Rotational with a little forward Force at +1.

Applied Forces based on this Tutorial:

This could also be applied to Chaos vehicle input Throttle and the Yaw turn under Arcade controls if you have to use it. But for me as i said there were too many bugs.

3 Likes

So, any news on this?

I’m also working on a project that involves tanks, and honestly I’ve been rather unsuccessful trying to emulate something like a double differential system even in C++. I tried overriding a bunch of functions related to input and mechanic sim but whenever I think I’ve gotten somewhere, something else breaks. :smiling_face_with_tear:

Essentially what I tried was to make the vehicle system translate the steering input as a secondary throttle that by default makes one of the tracks go in reverse.

The problem is that the functionality is all over the place and there’s a bunch of redundant features that get in the way. Input values are read in many places, some in the component itself, some in the physics vehicle sim object, some even inside even engine or transmission sim objects, and there are many side-effects when you tinker with them.

In fact the closest I got to make it work was to go crazy and make the wheeled vehicle actor with just the tracks of one side, then attach two as child actors with physics constraints to a pawn containing just the body. Then I’d try to calculate what throttle to send to the two ā€œsub-vehiclesā€ to be able to steer the whole thing.

It sorta worked but handling internal collisions, center of gravity and mass was a real b*tch. I guess it was like trying to simulate a trailer attached to two trucks. Or maybe a Star Wars podracer, I guess.

Set Drive Torque allows you to adjust individual wheels. You need to cast the VehicleMovementComponent to a ChaosWheeledVehicleMovementComponent to access Set Drive Torque.

I’m still trying it out by making the left side’s wheels spin opposite of right, but it all seems to work in theory. It just gets weird when trying to turn from a dead stop. Probably just a matter if tweaking a zillion wheel friction settings