Making a part Tilt as it turns?

Greetings, I’m trying to make a part tilt as it turns. I’ve tried looking at old ROBLOX Boat models - But had no luck what so ever.

This is currently how piloting works - I was wondering how to make it so that it tilts as you turn.

CraftModel.Controls["Pilot"].Changed:Connect(function(Prop)
if CraftData.isFlying == true then
	if Prop == "Throttle" or "Steer" then
		if (CraftModel.Controls["Pilot"].Throttle == -1) then
		BV.Velocity = CraftModel.Exterior["Base"].CFrame.LookVector * -CraftData.Speed
		elseif (CraftModel.Controls["Pilot"].Throttle == 1) then
		BV.Velocity = CraftModel.Exterior["Base"].CFrame.LookVector * CraftData.Speed
		elseif (CraftModel.Controls["Pilot"].Throttle == 0) then
		BV.Velocity = Vector3.new(0, 0, 0)
		end
			
		if (CraftModel.Controls["Pilot"].Steer == -1) then
		BAV.AngularVelocity = Vector3.new(0, 1, 0)
		elseif (CraftModel.Controls["Pilot"].Steer == 0) then
		BAV.AngularVelocity = Vector3.new(0, 0, 0)
		elseif (CraftModel.Controls["Pilot"].Steer == 1) then
		BAV.AngularVelocity = Vector3.new(0, -1, 0)
		end
	end
else return end
end)
2 Likes

BodyGyro or AlignOrientation can both do what you are trying to achieve, the only issue is that BodyGyro only works in world space, while AlignOrientation requires a second part/attachment to work.

2 Likes

I’ve chosen a basic flight for my ships as the piloting won’t be the priority of the game.
However, with this being the code how would I implement the tilting upon turning?

while CraftData.isFlying == true do wait()
	if (CraftModel.Controls["Pilot"].Throttle == -1) then
		BV.Velocity = CraftModel.Exterior["Base"].CFrame.LookVector * -CraftData.Speed / 2
		elseif (CraftModel.Controls["Pilot"].Throttle == 1) then
		BV.Velocity = CraftModel.Exterior["Base"].CFrame.LookVector * CraftData.Speed
		elseif (CraftModel.Controls["Pilot"].Throttle == 0) then
		BV.Velocity = Vector3.new(0, 0, 0)
	end
	
	if (CraftModel.Controls["Pilot"].Steer == -1) then
		BAV.AngularVelocity = Vector3.new(0, 1, 0)
		elseif (CraftModel.Controls["Pilot"].Steer == 0) then
		BAV.AngularVelocity = Vector3.new(0, 0, 0)
		elseif (CraftModel.Controls["Pilot"].Steer == 1) then
		BAV.AngularVelocity = Vector3.new(0, -1, 0)
	end
end

The simplest way would be to use a small root part at the center and weld (real welds, not WeldConstraints) the main part of the model to it. Then you can tilt the whole model by changing the C0 value of the weld, while the body movers are applied to the root part.

1 Like

Completely understood your logic behind this -
However, this was the end result:

image

The root part has to be heavier than the rest. Set its density in custom properties to max and try making the rest of the plane weightless. You can also increase the root part’s volume to further increase its mass, just make sure to keep it CanCollide false.

1 Like

This works beautifully.
Thank you so much!

https://gyazo.com/bb2edbd52f3c70f44af6d55193a61e43

2 Likes