Fixing rider position on FiveM motorcycles
Floating hands, feet through the floorboards or no passenger seat on a FiveM bike? How layouts, seat bones and hbgrip offsets fix the rider.
Hands floating above the grips or buried in them, feet hovering over the floorboards, a passenger sitting inside the backrest, or no passenger seat at all. On add-on bikes the model is rarely the problem. A few bones in the .yft and one line in vehicles.meta decide where the rider goes, and you can fix nearly all of it without touching animations.
This is about bikes that load but look wrong with a rider on them. For getting a bike running in the first place, use the install guide.
What places the rider
There's no stored rider pose. The game plays the seated animation from the layout, then IK pulls hands and feet towards bones on the bike. Four things matter:
- Layout in
vehicles.meta, e.g.<layout>LAYOUT_BIKE_FREEWAY</layout>. It picks the posture: cruiser lean-back, sport tuck, dirt bike stance. - Seat bones
seat_f(rider) andseat_r(passenger). The pelvis goes here. - Grip bones
hbgrip_landhbgrip_r, children ofhandlebars. The hands go here. - handlebars, the bone the game rotates when you steer.
One of these missing, misplaced or parented wrong and the rider breaks, no matter how good the mesh looks.
Pick the layout first
Match the layout to how the bike is ridden before moving any bone. A sport layout on a long cruiser leans the rider into the tank; a cruiser layout on a sport bike sits them upright with arms stretched out. Bone tweaks won't fix a posture meant for a different bike.
| Bike type | Layout | Vanilla reference |
|---|---|---|
| Bagger / tourer with floorboards | LAYOUT_BIKE_FREEWAY | Western Bagger |
| Sport | LAYOUT_BIKE_SPORT | Dinka Akuma (Bati 801 uses LAYOUT_BIKE_SPORT_BATI) |
| Chopper | LAYOUT_BIKE_CHOPPER | Western Daemon, Zombie Chopper |
| Dirt bike | LAYOUT_BIKE_DIRT | Maibatsu Sanchez |
The vanilla bike on the same layout is what you measure against in the next steps.
Hands floating or inside the grips
Most people put hbgrip_l and hbgrip_r on the centre of the bar tube. The IK target is closer to where the palm sits, so on the tube centre the fingers end up inside the grip.
We measured instead of guessing. On the Western Bagger the grip bones sit about 3 cm forward and 1.6 cm above the grip axis. Relative to seat_f the Bagger's grip bone is roughly at x 0.372, y 0.619, z 0.275 (metres), grip radius about 1.9 cm.
Measuring your own reference
- Export the vanilla bike for your layout (e.g.
bagger.yftandbagger_hi.yft) to XML with CodeWalker and import it with Sollumz. - Note the world positions of
seat_f,hbgrip_l,hbgrip_rand the grip tube. - Keep the same offset from the grip axis on your bike and a similar grip-to-seat distance. If your bars are much wider or taller, move the bars, not only the bones.
- Make sure both grip bones are children of
handlebars. Parented tochassis, the hands stay still while the bars turn.
Feet floating or clipping
Feet follow the animation, not a bone. You fix them by moving the floorboards or pegs, or seat_f, again against the vanilla bike on the same layout:
- Note how far below and in front of
seat_fthe vanilla footrest is. - Put yours at the same offset.
- Legs too bent or too straight means the seat height is wrong for the layout. Move
seat_fand the seat mesh together.
Common one on baggers: floorboards modelled at a steep angle because it looks better. The animation expects a fairly flat board and the heel goes through. Flatten it or rotate it as one piece; don't stretch the mesh.
Passenger seat missing or clipping
- Bone. No
seat_rin the.yft, no seat. - Layout. The layout needs a passenger seat. With a custom layout in
vehiclelayouts.meta, check the seat list and that it's loaded withdata_file 'VEHICLE_LAYOUTS_FILE'. - Clearance. Passenger through the backrest, sissy bar or top case: move
seat_rforward a few centimetres or move the backrest. On one build we moved it from -1.56 to -1.43 before the back stopped going through the pad.
Testing in game
IK only runs in game, so Blender won't show these problems. When we test a bike we:
- get on and off from both sides, since enter and exit use the seat bones too;
- steer full lock both ways while stopped; a hand leaving the grip means the grip bone isn't following
handlebars; - check first person, where floating hands are obvious;
- try a passenger with a bigger ped model.
Bike flipping on its own or not letting anyone on? See troubleshooting. Our Western Gladius chopper was set up this way, with grip offsets taken from the vanilla Bagger.