i have a bounce pad script and the linear movement stops the player from moving. is there a fix?
code:
local result = workspace:Raycast(pos, rootPart.CFrame.UpVector * -3, params)
if result and self.LastBounce < (tick() - 1) then
self.root.Sound:PlaySound("Bounce")
self.LastBounce = tick()
local vel = Instance.new("LinearVelocity")
local att = Instance.new("Attachment")
local vector = result.Instance:GetAttribute("Direction")
if result.Instance:GetAttribute("Type") == "Directional" then
local copyVector = rootPart.CFrame.LookVector
vector = Vector3.new(vector.X * copyVector.X, vector.Y, vector.Z * copyVector.Z)
end
vel.MaxForce = math.huge
vel.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
vel.ForceLimitMode = Enum.ForceLimitMode.PerAxis
vel.VectorVelocity = vector or Vector3.new(0, 50, 0)
att.Position = Vector3.new(0, 0, 0)
vel.Parent = rootPart
vel.Attachment0 = att
att.Parent = rootPart
wait(result.Instance:GetAttribute("Duration") or 0.25)
vel:Destroy()
att:Destroy()
end