Body gyro not allowing part to rotate

Hello, I’m working on a bike and I’m in the 1st step of the scripting, making the bike stand up when someone gets on it.

I started searching about align orientation but I didn’t understood well how to use it. So I decided to use bodygyro, when i ended the script i noticed that body gyro restrics all axis of orientation but I just want to change one

script:

local Bike = script.Parent
local Seat = Bike.VehicleSeat

Seat:GetPropertyChangedSignal("Occupant"):Connect( function()
	
	if Seat.Occupant then
		
		local BodyGyro = Instance.new("BodyGyro")

		BodyGyro.Parent = Bike.PrimaryPart
		BodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
		BodyGyro.P = 1000
		BodyGyro.D = 100
		BodyGyro.CFrame = CFrame.Angles(0, 0, math.rad(0))
	end
end)

Issue:

So, I’m using bodygyro wrong or I should use align orientation? Any help would be appreciated.

Make the force math.huge, 0 , math.huge instead.

1 Like

You should delete the instance when there is no one seated, you can use ChildAdded event.

2 Likes

I’m intending to do this later.

1 Like

Actually it works, how i didn’t think about that, removing the torque from the axis I don’t want to rotate :sweat_smile:

Bodygyro only affects orientation, not position