Skip to content

Colliders

WhistleWiz edited this page Jan 13, 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)

[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.

[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. 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 and use them instead.

[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

Clone this wiki locally