I’m trying to create a manual transmission for a vehicle.
This appears to be native to UE4+, but not for UDK.
Currently I’m setting a new curve for TorqueVSpeedCurve in the VehicleSim class as the player switches between gears. However I can’t figure out how to slow the vehicle if you switch to a gear with a low torque while going downhill. Even if there’s only 10 torque, if the vehicle is going downhill, it will continue to accelerate.
I’m really not sure how to set a max speed for the vehicle.
Any insights would be welcome. Thanks.
You can find variables like MaxSpeed from SVehicle and GroundSpeed from Pawn. Look into using those to cap your velocity.
I wouldn’t try to simulate torque too closely. I would try to think of the situation as “at a certain rpm in a certain gear, the vehicle wants to be moving at this speed.” And then increase or decrease the speed to match, unless you’re too far away from that speed, in which case the vehicle will stall or accelerate very slowly (like trying to go from stop to 5th gear) or make a lot of noise and take damage (as you downshift into 1st gear while going 60 miles per hour).
Ahhh! Thank you @NodSaibot
I don’t know how I missed that. I was so focused on the VehicleSim class.