Skip to content

TuningPart

public sealed class TuningPart

Namespace Chassis.Api

Added in 1.3.0

One tuning part: a visual piece (spoiler, bumper, rims), a performance upgrade (engine, brakes), or both. Register it on every peer with ChassisApi.RegisterTuningPart; a car carries at most one part per Slot.

public string Id

Added in 1.3.0

Unique id, saved with the car. Lower case with a mod prefix, e.g. “mymod_gtwing”.

public string Slot

Added in 1.3.0

The slot the part goes into: wheels, spoiler, bumper_front, bumper_rear, skirts, hood, grille, exhaust, roof, fenders, cage, engine, brakes, transmission, suspension, turbo, tyres, or a slot of your own.

public string Label

Added in 1.3.0

Name for menus.

public int Price

Added in 1.3.0

Price for a shop. Chassis does not charge it.

public Func<LandVehicle, GameObject> Build

Added in 1.3.0

Makes the part’s model; Chassis parents it to the car and places it with the car’s PartFit. Null for a part that only changes how the car drives. Renderer materials whose name starts with “paint”, “paint2” or “rim” take the car’s paint, second paint or rim colour. A “wheels” part gives one rim facing +X; Chassis puts a copy on every wheel, scaled to the stock rim.

public TuningStats Stats

Type: TuningStats

Added in 1.3.0

How the part changes driving. Null for a part that only looks different.

public Dictionary<string, PartFit> Fits

Type: PartFit

Added in 1.3.0

Placement per vehicle code. A part with a Build fits only the codes listed here, except a “wheels” part, which fits every car. A part without a model and with no entries fits every car.

public bool FitsCode(string code)

Added in 1.3.0

Whether this part goes on cars of this code.

public PartFit FitFor(string code)

Types: PartFit

Added in 1.3.0

The placement on cars of this code, or null.