Hatches - NeisesMike/VehicleFramework GitHub Wiki

A hatch is used for the player to enter and exit the vehicle. Hatches is not a field of ModVehicle, but both Submersibles and Submarines define the same field:

public abstract class Submarine : ModVehicle
{ 
    ...
    public abstract List<VehicleParts.VehicleHatchStruct> Hatches { get; }
    ...
}

This is the definition of the VehicleHatchStruct struct.

public struct VehicleHatchStruct
{
	public GameObject Hatch;
	public Transform EntryLocation;
	public Transform ExitLocation;
	public Transform SurfaceExitLocation;
}

Hatch is the actual object you'll click on to enter and exit the vehicle. Make sure this GameObject has a collider!

EntryLocation is where the Player will end up upon clicking the Hatch to enter the vehicle. If you're making a Submarine, be sure the interior space is big enough to accommodate the player. Otherwise, the player might be squeezed out of the vehicle.

ExitLocation is the same, but for exiting the vehicle.

SurfaceExitLocation is just like ExitLocation, except that it must allow clearance for the Player to exit in a standing position. That is, if the player exits to the top of the vehicle, SurfaceExitLocation must be high enough off the top so that the Player's feet don't clip into the vehicle.