- I would like to get it just so that way I could drive the bus forward in gear to a destination without (literally) sling-shot-ing off the map or trying to move backwards.
^^I am holding W the entire time, I’ve noticed a pattern were the left wheel is the one to spin backwards though the motor says it will spin positive.
- I’ve tried to swap the motors to the back wheels and that didn’t work it just has the same bug if not worse in my opinion, It just moves forwards and backwards quicker and quicker until it flies off the baseplate. I have a solution in mind (Welding one motor to both back wheels) but I don’t want to use it because it would dis-allow the outer wheel to spin faster in a turn. I have used the select tool to monitor both wheels values and that’s mostly why I came here, it says in Motor.AngularVelocity that it is spinning the way it is supposed to. In this instance in the video that would be 5 for the left motor and -5 for the right motor.
Another note for steering the outer wheel will turn 5 (degrees) - I say that lightly, more than the inner one.
-- Main Values
local s = script
local seat = script.Parent.Parent
--Gear And Starter Values
local Gear = script.MovingValues.Gear
local Starter = script.MovingValues.StarterState
--Motors
print("Im alive")
local MotA = script.MotorGuide.MotA.Value --Always spins positive to go forward
local MotB = script.MotorGuide.MotB.Value --Always spins negative to go forward
local Bfolder = s.MovingValues.Bfolder.Value
local MotC = script.MotorGuide.MotC.Value
local MotD = script.MotorGuide.MotD.Value
FrontTop = Bfolder.TailLight.TRFront
FrontBottom = Bfolder.TailLight.BRFront
Top = Bfolder.TailLight.Top
RL = Bfolder.RL
speed = script.Parent.Values.Speed
local function NegativeTwo()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = -5
MotB.HingeConstraint.AngularVelocity = 5
RL.Material = Enum.Material.Neon
end
local function NegativeOne()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = -2
MotB.HingeConstraint.AngularVelocity = 2
RL.Material = Enum.Material.Neon
end
local function Neutral()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.None then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.None
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.None
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = 0
MotB.HingeConstraint.AngularVelocity = 0
RL.Material = Enum.Material.SmoothPlastic
end
local function GearOne()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = 5
MotB.HingeConstraint.AngularVelocity = -5
RL.Material = Enum.Material.SmoothPlastic
end
local function GearTwo()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = 10
MotB.HingeConstraint.AngularVelocity = -10
RL.Material = Enum.Material.SmoothPlastic
end
local function GearThree()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = 15
MotB.HingeConstraint.AngularVelocity = -15
RL.Material = Enum.Material.SmoothPlastic
end
local function GearFour()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = 25
MotB.HingeConstraint.AngularVelocity = -25
RL.Material = Enum.Material.SmoothPlastic
end
local function GearFive()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = 30
MotB.HingeConstraint.AngularVelocity = -30
RL.Material = Enum.Material.SmoothPlastic
end
local function GearSix()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
--Speed/Velocity--
MotA.HingeConstraint.AngularVelocity = 50
MotB.HingeConstraint.AngularVelocity = -50
RL.Material = Enum.Material.SmoothPlastic
end
local function Brakes()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.Motor then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.Motor
end
MotA.HingeConstraint.AngularVelocity = -.01
MotB.HingeConstraint.AngularVelocity = .01
FrontTop.Material = Enum.Material.Neon
FrontBottom.Material = Enum.Material.Neon
Top.Material = Enum.Material.Neon
end
local function Coast()
if MotA.HingeConstraint.ActuatorType == Enum.ActuatorType.None then
else
MotA.HingeConstraint.ActuatorType = Enum.ActuatorType.None
MotB.HingeConstraint.ActuatorType = Enum.ActuatorType.None
end
FrontTop.Material = Enum.Material.SmoothPlastic
FrontBottom.Material = Enum.Material.SmoothPlastic
Top.Material = Enum.Material.SmoothPlastic
end
print("Im alive here too")
--Main Function
seat.Changed:connect(function(property)
while task.wait() do
if property == "Throttle" then
--Drive Controls--
if seat.Throttle == 1 then
--Checking Gear--
FrontTop.Material = Enum.Material.SmoothPlastic
FrontBottom.Material = Enum.Material.SmoothPlastic
Top.Material = Enum.Material.SmoothPlastic
if Gear.Value == -2 then
NegativeTwo()
elseif Gear.Value == -1 then
NegativeOne()
elseif Gear.Value == 0 then
Neutral()
elseif Gear.Value == 1 then
GearOne()
elseif Gear.Value == 2 then
GearTwo()
elseif Gear.Value == 3 then
GearThree()
elseif Gear.Value == 4 then
GearFour()
elseif Gear.Value == 5 then
GearFive()
elseif Gear.Value == 6 then
GearSix()
end
--End of Gear Spectrum--
elseif seat.Throttle == -1 then
Brakes()
elseif seat.Throttle == 0 then
Coast()
end
end
end
end)
I don’t think this falls under re-write entire scripts or any TOS, thats not my goal. Im just trying to figure out why the motor is spinning backwards when it clearly shouldn’t.
Update 1: I have the shaking back and forth off the map fixed. It was a motor bugging out in a different script. (woohooo) , Still trying to find a fix for the current motors trying to go backwards when instructed to go forwards. (Thinking of re-writing the entire script to make it a little more tidy and effecient)