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!