--Suspension Bases


local fbaseA = bike.FrontSection.TripleTreeHinge:Clone()
fbaseA.Parent = bike.FrontSection
fbaseA.Name = "FrontSuspensionBase"
if _Tune.FBricksVisible or _Tune.Debug then fbaseA.Transparency = .75 else fbaseA.Transparency = 1 end
fbaseA.Orientation = bike.FrontSection.TripleTreeHinge.Orientation
fbaseA.CFrame = fbaseA.CFrame+(Vector3.new(_Tune.FBaseOffset[1],_Tune.FBaseOffset[1],_Tune.FBaseOffset[1])*fbaseA.CFrame.rightVector)
fbaseA.CFrame = fbaseA.CFrame+(Vector3.new(_Tune.FBaseOffset[2],_Tune.FBaseOffset[2],_Tune.FBaseOffset[2])*fbaseA.CFrame.upVector)
fbaseA.CFrame = fbaseA.CFrame+(Vector3.new(_Tune.FBaseOffset[3],_Tune.FBaseOffset[3],_Tune.FBaseOffset[3])*fbaseA.CFrame.lookVector)

local fbaseB = axle2:Clone()
fbaseB.Parent = bike.FrontSection
fbaseB.Name = "FrontSuspensionAxle"
if _Tune.FBricksVisible or _Tune.Debug then fbaseB.Transparency = .75 else fbaseA.Transparency = 1 end
fbaseB.Orientation = bike.FrontSection.TripleTreeHinge.Orientation
fbaseB.CFrame = fbaseB.CFrame+(Vector3.new(_Tune.FAxleOffset[1],_Tune.FAxleOffset[1],_Tune.FAxleOffset[1])*fbaseB.CFrame.rightVector)
fbaseB.CFrame = fbaseB.CFrame+(Vector3.new(_Tune.FAxleOffset[2],_Tune.FAxleOffset[2],_Tune.FAxleOffset[2])*fbaseB.CFrame.upVector)
fbaseB.CFrame = fbaseB.CFrame+(Vector3.new(_Tune.FAxleOffset[3],_Tune.FAxleOffset[3],_Tune.FAxleOffset[3])*fbaseB.CFrame.lookVector)
fbaseB.CustomPhysicalProperties = PhysicalProperties.new(0,0,0,0.1,0.1)

local faxlea = Instance.new("Attachment", fbaseA)
local fwheela = Instance.new("Attachment", fbaseB)

local rbase = axle:Clone()
rbase.Parent = bike.Body
rbase.Name = "RearSuspensionBase"
if _Tune.RBricksVisible or _Tune.Debug then rbase.Transparency = .75 else rbase.Transparency = 1 end
rbase.Orientation = bike.RearSection.RearSwingArmHinge.Orientation
rbase.CFrame = rbase.CFrame+(Vector3.new(_Tune.RBaseOffset[1],_Tune.RBaseOffset[1],_Tune.RBaseOffset[1])*rbase.CFrame.rightVector)
rbase.CFrame = rbase.CFrame+(Vector3.new(_Tune.RBaseOffset[2],_Tune.RBaseOffset[2],_Tune.RBaseOffset[2])*rbase.CFrame.upVector)
rbase.CFrame = rbase.CFrame+(Vector3.new(_Tune.RBaseOffset[3],_Tune.RBaseOffset[3],_Tune.RBaseOffset[3])*rbase.CFrame.lookVector)

local raxlea = Instance.new("Attachment", axle)
local rwheela = Instance.new("Attachment", rWheel)
local rhinge = Instance.new("HingeConstraint", axle)
rhinge.Attachment0 = raxlea
rhinge.Attachment1 = rwheela
rhinge.ActuatorType = "Motor"
rhinge.MotorMaxAcceleration = 9e9

local rbaseattch = Instance.new("Attachment", rbase)
local rshock = Instance.new("SpringConstraint", rbase)
rshock.Attachment0 = raxlea
rshock.Attachment1 = rbaseattch
rshock.Visible = _Tune.RConstsVisible or _Tune.Debug
rshock.LimitsEnabled = true
rshock.Damping = _Tune.RSusDamping
rshock.Stiffness = _Tune.RSusStiffness
rshock.FreeLength = _Tune.RSusLength+_Tune.RPreComp
rshock.MaxLength = _Tune.RSusLength+_Tune.RExtLimit
rshock.MinLength = _Tune.RSusLength-_Tune.RCompLimit

local fshock = Instance.new("SpringConstraint", fbaseA)
fshock.Attachment0 = fwheela
fshock.Attachment1 = faxlea
fshock.Visible = _Tune.FConstsVisible or _Tune.Debug
fshock.LimitsEnabled = true
fshock.Damping = _Tune.FSusDamping
fshock.Stiffness = _Tune.FSusStiffness
fshock.FreeLength = _Tune.FSusLength+_Tune.FPreComp
fshock.MaxLength = _Tune.FSusLength+_Tune.FExtLimit
fshock.MinLength = _Tune.FSusLength-_Tune.FCompLimit

local fpris = Instance.new("PrismaticConstraint", fbaseA)
fpris.Attachment0 = faxlea
fpris.Attachment1 = fwheela
fpris.Visible = _Tune.FConstsVisible or _Tune.Debug
fpris.LimitsEnabled = true
fpris.UpperLimit = _Tune.FSusLength+_Tune.FExtLimit
fpris.LowerLimit = _Tune.FSusLength-_Tune.FCompLimit

local faxleb = Instance.new("Attachment", axle2)
local fwheelb = Instance.new("Attachment", fWheel)
local fhinge = Instance.new("HingeConstraint", axle2)
fhinge.Attachment0 = faxleb
fhinge.Attachment1 = fwheelb
fhinge.ActuatorType = "Motor"
fhinge.MotorMaxAcceleration = 9e9
