AlignOrientation shifting randomly

Hi there!

I have been making a wheelchair and using align orientation to make it stay upright and run smoothly when moving.

However, when enabled, the align orientation causes the wheelchair to randomly shift directions after the wheelchair stops moving.

Here’s a picture of the settings I used for the AlignOrientation:

Here’s the script used to control the wheelchair

local proximityPrompt = script.Parent
local seat = proximityPrompt.Parent
local part = seat.Parent --Primary part of the wheelchair
local chair = part.Parent

seat:GetPropertyChangedSignal("Throttle"):Connect(function()
	print(seat.Throttle)
	if part:FindFirstChild("Main") ~= nil then
		if seat.Throttle == 1 then
			for i, v in pairs (part:FindFirstChild("Main"):GetDescendants()) do
				if v:IsA("HingeConstraint") and v.Name == "HingeConstraint" then
					v.AngularVelocity = 10
				end

			end
		
		elseif seat.Throttle == 0 then
			for i, v in pairs (part:FindFirstChild("Main"):GetDescendants()) do
				if v:IsA("HingeConstraint") and v.Name == "HingeConstraint" then
					v.AngularVelocity = 0
					
				end

			end
			
		elseif seat.Throttle == -1 then
			for i, v in pairs (part:FindFirstChild("Main"):GetDescendants()) do
				if v:IsA("HingeConstraint") and v.Name == "HingeConstraint" then
					v.AngularVelocity = -10

				end

			end
		end
	end
end)

The wheelchair itself uses hinge constraints to move, but I don’t suspect it to be the issue.

Any help is appreciated!

I would recommend disabling RigidityEnabled. Then, set the MaxTorque to something like 10000. Responsiveness to around 10-20. But I think seeing the script that controls the AlignOrientation may be useful.

1 Like

Hey just checking in, did my previous suggestion work? I’m guessing if it did it was RigidityEnabled. But knowing Body Mover behavior it likely did not work and it has something to do with the code, like for example once the player no longer has throttle response, setting MaxTorque to 0 (For the AlignOrientation) or just flat out disabling it may be the way to go.

1 Like

Apologies for the late response!

I just tested out the settings that you suggested, but the wheelchair still yanks itself to the left or right when it stops moving.

I also tried lowering the MaxTorque and the shifting stopped happening. However, it causes the wheelchair to run roughly and behaves more or less the same as when align orientation is disabled:

(As you can see at MaxTorque 10, the wheelchair is very bumpy)

If there are any other alternatives to make the wheelchair run without any choppiness, I would be open to using that instead.