Pilot Seats - NeisesMike/VehicleFramework GitHub Wiki
A pilot seat controls where the Player's body will go while they are controlling your vehicle. PilotSeat is actually not a field of ModVehicle, but it is a field in Submarine and Submersible. Notably, Drones do not have pilot seats.
Submersibles have exactly one.
public abstract class Submersible : ModVehicle
{
...
public abstract VehicleParts.VehiclePilotSeat PilotSeat { get; }
...
}
Submarines can have several.
public abstract class Submarine : ModVehicle
{
...
public abstract List<VehicleParts.VehiclePilotSeat> PilotSeats { get; }
...
}
This is the definition of the VehiclePilotSeat struct.
public struct VehiclePilotSeat
{
public GameObject Seat;
public GameObject SitLocation;
public Transform LeftHandLocation;
public Transform RightHandLocation;
public Transform ExitLocation;
}
Seat
is the actual chair (collider) you'll click on to begin piloting. Make sure this GameObject has a collider!
SitLocation
is to where the Player's camera will snap when they begin controlling the vehicle with this chair.
LeftHandLocation
refers to the left hand plug of the steering wheel. If you set this to a non-null value, the player's left hand will snap to this Transform while they are piloting. This is useful if you have a steering wheel that you want the player to hold.
RightHandLocation
refers to the right hand plug of the steering wheel.
ExitLocation
is where the Player will be placed upon exiting pilot-mode. If you don't set this, VF will try to set the player just behind the seat. But this isn't always desirable and can cause the player to sometimes be ejected from the vehicle weirdly.