NetVehicle - maceeikodev/WreckMP_Ref GitHub Wiki

Definition

public class NetVehicle

Class used to store a vehicle object whose physics and controls are synced.

Fields

public Transform transform; - Root transform of the vehicle.

Properties

public NetVehicleDriverPivots driverPivots { get; } - Class containing all pivot points for driver animation.

public ulong Driver { get; } - Steam ID of the user who's overriding the controls. The controls aren't overriden if Driver is equal to 0 or WreckMPGlobals.UserID

public bool DriverSeatTaken { get; } - Whether the driver seat is taken.

public int Hash { get; } - Unique hash of the vehicle used for identification.

public ulong Owner { get; } - Steam ID of the vehicle's rigidbody's owner.

Constructors

public NetVehicle(Transform transform);

Creates an instance of NetVehicle class.

transform - The root transform of the vehicle.

Methods

public Transform AddPassengerSeat(Vector3 triggerOffset, Vector3 headPivotOffset);

Adds a passenger seat to the vehicle. Does NOT work in singleplayer!

triggerOffset - Passenger seat offset from the root transform.

headPivotOffset - Head offset of the passenger mode.

Returns: Root transform of the newly created passenger seat.

public void SendEnterDrivingMode();

Make car controls update from local player for everyone else.

public void SendExitDrivingMode();

Stop controls from being updated from local player.