Best way to do bike physics?

After following How to Rig a Car, I have started working on a test motorbike, however I have the problem of it toppling.

After spending a lot of time creating and positioning parts to try and balance out its mass, it doesn’t seem to help much.

https://gyazo.com/64635dbba1e00040253fdbe3f0965926

This is the sort of result I’m aiming for however vehicles are new to me.

6 Likes

I can’t really give you a full extensive answer, but I would recommend looking at the scripts for the roblox Roped gear (just search roped into the toolbox and you will find it).

The gear works using a BodyVelocity for movement and a BodyAngularVelocity for changing the direction the player is facing. It also uses a BodyGyro to simulate the ‘leaning’ effect.

6 Likes

I use spring and cylidrical constraints for mine, is it possible to use a certain bodymover to keep the bike up?

Yea so assuming the bike is all held together by welds and constraints or whatever then you can use a body gyro to set a target orientation for the bike.

For example the program below tries to keep a part always with (0,0,0) orientation.

local part = workspace.Part
local bg = Instance.new("BodyGyro")
bg.Parent = part
bg.CFrame = CFrame.new()

A body gyro to keep it up and a bodygyro for the turning have made this work. This is my progress with the bike so far.

https://gyazo.com/43e3b0c3b09f59f27a27fec65d280786

2 Likes