0 votes
by
Hi. I want to implement nitro system. Can I some how access engine torque via script?

1 Answer

0 votes
by
edited by

Sure. From a VehicleBehaviour-derived class you may use:

var vehicleController = vehicle.GetComponent<VPVehicleController>();
vehicleController.engine.peakRpmTorque = 144.0f;

That will configure the maximun torque value at the peak rpm value in runtime:

Engine settings reference:
https://vehiclephysics.com/blocks/engine/#nested-classes

by
Thanks Edy for reply.
I am using community edition therefore I cannot use Vehicle behaviour derived class. Can I achieve the same in community edition?
Thanks again.
by
Yes, you have to get a reference to the VPVehicleController component of the vehicle, then modify engine.peakRpmTorque as above.
...