Tether Sources - NeisesMike/VehicleFramework GitHub Wiki

Tether Sources are part of a system to detect when the player is inside of or has exited your vehicle.

Tether sources are only useful in weird situations like when the player is squeezed out or teleports into/out of the vehicle.

For example, without tether sources, teleporting out of your vehicle will result in the player falling to the ocean floor.

That means tether sources are super useful.

For best effect, you must define the ModVehicle's Bounding Box.

Overview

Submarine has the field:

public virtual List<GameObject> TetherSources => new List<GameObject>();

You have two options.

Option 1

If you defined the ModVehicle's Bounding Box, you can give your TetherSources each a SphereCollider. And you can configure that SphereCollider's radius as you like. This is the better option. It lets you easily draw circles inside your vehicle.

When the player enters a sphere collider, they will "enter" the vehicle if they haven't already.

When the player exits the bounding box collider, they will "exit" the vehicle if they haven't already.

Option 2

When the player gets to within 1 meter of the main PilotSeat, they will "enter" the vehicle if they haven't already.

When the player gets to within 1 meter of the vehicle's origin, they will "enter" the vehicle if they haven't already.

When the player moves more than 10 meters away from the vehicle's origin, they will "exit" the vehicle if they haven't already.

Hopefully you can see why you should use Option 1.

⚠️ **GitHub.com Fallback** ⚠️