How to set up vehicle collision in Sollumz

By Nilo3D · Updated:

The collision of a GTA V vehicle is a Bound Composite inside the .yft, with one collision shape per functional part, each following a bone. In Sollumz a bound works when two things are true: the bone has Fragment Physics switched on, and the bound object follows that bone through a constraint. A vehicle exported without bounds falls through the map.

Where does vehicle collision live?

A vehicle has no separate collision file. Its collision is part of the fragment, next to the visible model:

mycar                  Armature, Sollumz type: Fragment (bones = the car's parts)
  mycar.mesh           Empty, Sollumz type: Drawable
    chassis            Mesh, Drawable Model (skinned to the bone "chassis")
    bodyshell          Mesh, Drawable Model
    door_dside_f       Mesh, Drawable Model
    wheel_lf           Mesh, Drawable Model, "Is Wheel Mesh" on
    ...
  mycar.col            Empty, Sollumz type: Bound Composite
    chassis.col        Bound Geometry, follows the bone "chassis"
    wheel_lf.col       Bound Disc, follows the bone "wheel_lf"
    door_dside_f.col   Bound Geometry, follows the bone "door_dside_f"
    ...

The Bound Composite is a container. The shapes under it do the work, and each one belongs to a bone, so a door's collision swings with the door and a wheel's collision sits where the wheel is. To see them while you work, use Sollumz Tools > General > View > Show Collisions.

Which bound type goes on which part?

Add shapes in Sollumz Tools > Collisions > Create Bounds with Create Bound and the type menu next to it. Stock vehicles use one bound per functional part, never one merged shape for the whole car.

PartSollumz typeShape
Body (chassis)Bound GeometryA simple closed hull around the body.
Each wheelBound DiscA disc the size of the tyre.
Doors, bonnet, boot, bumpersBound GeometryA hull around each part.
WindowsBound GeometryA thin shape over the pane, with a glass collision material.
Simple blocksBound Box, Bound Sphere, Bound Capsule, Bound CylinderSized with the values in the bound's Shape panel.

The fastest correct start is to copy the bounds of the stock vehicle you imported as reference. A copy keeps the type, the material and the mass. Then replace the mesh of each hull with one that fits your part. The hull mesh is written relative to its bone, so build it with the part at the bone's position.

Which materials do bounds use?

Bounds take collision materials only. They decide the sound, the sparks and the bullet behaviour of the surface. Pick one in Sollumz Tools > Collisions > Create Collision Material and press Create Collision Material. For a car body the usual one is Car Metal; there are also Car Plastic and the Car Glass materials for the windows.

Never leave a normal render material on a bound. On one of our cars a visible material on a wheel bound was enough to make the export fail.

How is mass set?

Each bound has its own mass, shown on the bound object, and the masses add up to the weight of the model. Sollumz Tools > Fragments > Set Mass writes one value to all selected objects. Copying the bounds of a similar stock vehicle gives sensible numbers from the start.

Mass also sets the centre of gravity. When we added helper bounds at 200 kg each to one car, they moved its centre of mass and changed how it drove. Extra bounds that are only there to collide should weigh about 1 kg. The mass the driving physics uses is still fMass in handling.meta.

Do vehicle bounds need collision flags?

Each bound has a Composite Flags panel with two rows of switches: what the shape is, and what it collides with. On the stock vehicles we have opened, these are empty on the vehicle's bounds, and that is normal. Vehicle bounds do not need the map flags.

Map objects and props are different. There, a bound with no flags exports without any warning and collides with nothing in game. For those, apply a flag preset to every bound; Sollumz ships one named General (Default). If you move between props and vehicles, do not carry the rule from one to the other.

Why does my vehicle fall through the map?

SymptomCauseFix
Falls through the road as soon as it spawnsThe fragment has no Bound Composite, or it was not exportedAdd the bounds as children of the armature and export with the armature selected.
Sits on its belly, wheels in the groundNo wheel bounds, or they do not follow the wheel bonesOne Bound Disc per wheel bone, sized to the tyre.
Export warns about a bone without collisionFragment Physics is on but no bound follows the boneAdd the constraint, or switch physics off for that bone.
Collision is offset from the modelThe bound was moved by hand and by the constraintReset the bound's own position and let the constraint place it.
Players walk through a partThat part has no bound of its ownAdd a bound on that part's bone.
Car drives nose-down or tips overHeavy extra bounds moved the centre of massLower their mass.

If the model is fine and only the ride height is wrong, that is suspension, not collision: see vehicle troubleshooting.

How do I check the collision before a game test?

Export once with CW XML ticked in Target Formats and open the .yft.xml in a text editor. Under the physics section, the list of groups should name every bone you gave physics to, and the list of children should have one entry per bound. If the groups are missing, no bone had Fragment Physics on.

The rest of the model workflow is in how to make a FiveM vehicle in Blender with Sollumz.

Frequently asked questions

Why does my car fall through the map in FiveM?
The .yft has no collision. In Sollumz the vehicle needs a Bound Composite with bounds under the armature, each bound following a bone that has Fragment Physics switched on.
How do I add collision to a vehicle in Sollumz?
Create bounds in Sollumz Tools > Collisions > Create Bounds, tick Fragment Physics on the bone of each part, and add a bone constraint to each bound with Bone Tools > Add Bone Constraint.
What bound type do wheels use?
A Bound Disc on each wheel bone, sized to the tyre.
Do vehicle bounds need collision flags in Sollumz?
On the stock vehicles we have opened the flags on vehicle bounds are empty, and that is normal. Map objects and props do need flags on every bound.
What does "Bone has physics enabled, but no associated collision" mean?
A bone has Fragment Physics switched on but no bound follows it. Add a bound with a bone constraint to that bone, or switch physics off for the bone.

Sources

Products from this guide

All guides