#Hoverboard Going Up Forever

1 messages ยท Page 1 of 1 (latest)

north estuary
#

Help.

fervent scaffold
#

Sure, Could you send your script!

#

@north estuary

north estuary
#

Alr

#

local RunService = game:GetService("RunService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local connection = nil
local seat = nil
local attachment = nil
local vectorForce = nil
local orientation = nil
local alignOrientation = nil
local raycastParams = nil

local rayOffset = Vector3.new(0, -8, 0)
local rayVelocity = 0.2
local minimumThrust = 600
local thrust = 2000
local drag = 0.02

local animationTrack = humanoid:WaitForChild("Animator"):LoadAnimation(script:WaitForChild("Animation"))
animationTrack.Priority = Enum.AnimationPriority.Idle

local rayPart = Instance.new("Part")
rayPart.Anchored = false
rayPart.CanCollide = false
rayPart.CanQuery = false
rayPart.CanTouch = false
rayPart.Shape = Enum.PartType.Ball
rayPart.Size = Vector3.one
rayPart.Parent = workspace

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.Force = 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)
alignOrientation.CFrame = orientation * tiltOrientation

end

#

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:FindFirstChildOfClass("Model")}
connection = RunService.PostSimulation:Connect(Loop)
animationTrack:Play()
end
end

humanoid.Seated:Connect(Seated)

#

@sour wagon

#

@fervent scaffold

sour wagon
#
raycastParams.FilterDescendantsInstances = {character, seat:FindFirstChildOfClass("Model")}
#

this is not correct

fervent scaffold
#

Most likely these:
The rayPart should have Anchored set to true to prevent it from falling due to gravity.
The rayPart.BrickColor should use the BrickColor.new() constructor instead of BrickColor() to create a new BrickColor object.
The rayPart.Transparency is set to 1 to make the part invisible.
The velocity variable should use seat.Velocity instead of seat.AssemblyLinearVelocity.
The calculation of orientation should use Vector3.new() instead of Vector3.zero for better compatibility.
The raycastParams.FilterType should be set to Enum.RaycastFilterType.Blacklist instead of Enum.RaycastFilterType.Exclude to filter out the specified instances.
The raycastParams.FilterDescendantsInstances should exclude the seat itself using seat:FindFirstChildOfClass("Model") to avoid collision with the hoverboard.

north estuary
fervent scaffold
#

Try this:

north estuary
#

try what

fervent scaffold
north estuary
#

alr

#

its still goin up

#

but now diagonally

#

and it doesnt turn now

#

Its so annoying ๐Ÿ’€

fervent scaffold
#

@north estuarylook at your dms

north estuary
#

Alr

#

@sour wagon He a rando