Skip to content

Colliders

WhistleWiz edited this page Feb 29, 2024 · 14 revisions

Prefab Collider Structure

The colliders for a custom car follow the following structure:

  • [colliders]
    • [collision]
      • Child colliders
    • [walkable]
      • Child colliders
    • [items]
      • Child colliders
    • [camera dampening]
      • Child colliders
    • [bogies]
      • (Component: CapsuleCollider)
      • (Component: CapsuleCollider)

Important

Both [colliders] and [collision] MUST be at the origin, with no rotation and no scale applied.

image

[collision]

image

This is the collider of your car with the world. It's the most simple, usually just a single box around the entire car. Make sure there is enough spacing between this collider and the floor, or the car may have issues moving and around gradient changes.

[walkable]

image

This is the collider of the car with the player. It's usually more tight fitting than [collision]. To mimic vanilla behaviour, it is possible to add the component TeleportArcPassThroughProxy to children of this GameObject, which will allow the teleport arc to go through these colliders, while still blocking movement. It is used in the colliders covering the buffer stems and railings.

Colliders using TeleportArcPassThroughProxy in this example

image

[items] (optional)

image

This is the collider of the car with items, used while holding, placing or dropping them. It's even tighter fitting than the [walkable] colliders.

Note

This is OPTIONAL. If you do not want to create this set of colliders, do not include the GameObject and CCL will automatically copy the [walkable] colliders for this purpose.

[camera dampening]

image

We are not sure about what this collider is for, but it has a similar setup to [collision]. It should at least cover all the inner parts of the car.

[bogies]

image

These consist of two CapsuleCollider components on the [colliders].[bogies] transform. The are aligned with the outermost axle, running transverse to the car (round ends pointing out toward rails). The radius and width are set up to match up with the wheel riding surfaces if the capsule was centered around an axle.

Aligned colliders example

image

Tip

Press the Align Bogie Colliders button on your livery to automatically align the colliders to the outermost axles. If you are using vanilla bogies, they may look odd but will match the bogies ingame.

Clone this wiki locally