#Hoverboard will not float

1 messages · Page 1 of 1 (latest)

raw ether
#

I have been trying to figure out the issue for hours and I have yet to figure out the issue. The code is the exact same as the tutorial and it has yet to work, maybe because it was like a year ago but I have yet to figure out the problem and it keeps saying the things in the picture and doesn't get rid of the things in the shown pictures. The hoverboard doesn't even float up properly and just stays on the ground. I've just been so stuck on this and I'd like to figure out how to fix the issue, here's some of the areas for the errors shown in the picture.

local function Seated(active, currentSeat)
    if active == false then 
        if connection == nil then return end
        connection:Disconnect()
        connection = nil
        attachment:Destroy()
        vectorForce:Destroy()
        alignOrientation:Destroy()
        animationTrack:Stop()
    elseif currentSeat.Name == "Hoverboard" then
        seat = currentSeat
        attachment = Instance.new("Attachment", seat)
        vectorForce = Instance.new("VectorForce")
        vectorForce.Force = Vector3.zero
        vectorForce.ApplyAtCenterOfMass = true
        vectorForce.Attachment0 = attachment
        vectorForce.Parent = seat
        orientation = CFrame.fromMatrix(Vector3.zero, seat.CFrame.LookVector:Cross(Vector3.yAxis), Vector3.yAxis)
        alignOrientation = Instance.new("AlignOrientation")
        alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
        alignOrientation.CFrame = orientation
        alignOrientation.Attachment0 = attachment
        alignOrientation.Parent = seat
        raycastParams = RaycastParams.new()
        raycastParams.FilterType = Enum.RaycastFilterType.Exclude
        raycastParams.FilterDescendantsInstances = {character, seat:FindFirstAncestorOfClass("Model")}
        connection = RunService.PostSimulation:Connect(Loop)
        animationTrack:Play()
    end
end
#
local function Loop(deltaTime)
    local rayTarget =  seat.Position + rayOffset + seat.AssemblyLinearVelocity * rayVelocity
    local result = workspace:Raycast(seat.Position, rayTarget - seat.Position, raycastParams)
    if result == nil then
        vectorForce.Force = Vector3.new(0, minimumThrust, 0)
        rayPart.BrickColor = BrickColor.Green()
        rayPart.Position = rayTarget
    else
        local magnitude = (result.Position - rayTarget).Magnitude
        vectorForce = Vector3.new(0, minimumThrust + magnitude * thrust, 0)
        rayPart.BrickColor = BrickColor.Red()
        rayPart.Position = result.Position
    end
    local velocity = seat.CFrame:VectorToObjectSpace(seat.AssemblyLinearVelocity)
    if velocity.Magnitude > 0 then vectorForce.Force -= velocity.Unit * (drag * velocity.Magnitude ^ 2) end
    
    orientation *= CFrame.fromOrientation(0, -seat.SteerFloat * seat.TurnSpeed * deltaTime, 0)
    local tiltOrientation = CFrame.fromOrientation(-seat.ThrottleFloat * seat.Torque, 0, -seat.SteerFloat * seat.Torque)
    local counterX = math.clamp(-seat.AssemblyLinearVelocity.Z * counter, -seat.Torque, seat.Torque)
    local counterZ = math.clamp(-seat.AssemblyLinearVelocity.X * counter, -seat.Torque, seat.Torque)
    local counterOrientation = CFrame.fromOrientation(counterX, 0, counterZ)
    alignOrientation.CFrame = counterOrientation * orientation * tiltOrientation
raw ether
sinful dove
#

and see what it is

raw ether
#

alright

#

in a different script or the same one?

sinful dove
#

same one

#

doesnt matter

raw ether
#

alright

sinful dove
raw ether
#

ok

sinful dove
#

remove the .force at the end of vectorForce

#

and see if that works

raw ether
raw ether
#

🙏

sinful dove
#

did that fix it

#

did removing .force fix it

raw ether
#

yeah but it still wont fly

sinful dove
#

check the date of the tutorial

#

maybe its outdated

raw ether
#

july 9, 2023

#

oh

rustic depot
#

local connection
local attachment
local vectorForce
local alignOrientation
local animationTrack
local seat
local raycastParams
local orientation

local function Seated(active, currentSeat)
    if active == false then 
        if connection == nil then return end
        connection:Disconnect()
        connection = nil
        attachment:Destroy()
        vectorForce:Destroy()
        alignOrientation:Destroy()
        animationTrack:Stop()
    elseif currentSeat.Name == "Hoverboard" then
        seat = currentSeat
        attachment = Instance.new("Attachment", seat)
        vectorForce = Instance.new("VectorForce")
        vectorForce.Force = Vector3.new(0, 0, 0)
        vectorForce.ApplyAtCenterOfMass = true
        vectorForce.Attachment0 = attachment
        vectorForce.Parent = seat
        orientation = CFrame.fromMatrix(Vector3.new(0, 0, 0), seat.CFrame.LookVector:Cross(Vector3.yAxis), Vector3.yAxis)
        alignOrientation = Instance.new("AlignOrientation")
        alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
        alignOrientation.CFrame = orientation
        alignOrientation.Attachment0 = attachment
        alignOrientation.Parent = seat
        raycastParams = RaycastParams.new()
        raycastParams.FilterType = Enum.RaycastFilterType.Exclude
        raycastParams.FilterDescendantsInstances = {character, seat:FindFirstAncestorOfClass("Model")}
        connection = RunService.PostSimulation:Connect(Loop)
        animationTrack:Play()
    end
end```
raw ether