Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Zipline is extremely laggy, why?

Asked by 3 years ago

Hello, my fellow scripters and game developers, I am making a game of ziplining, but when I use it, my character rapidly spins and lags, though it still moves the player? what can I do to fix this, i would love some help, thank you, here is the code.

local TweenService = game:GetService("TweenService")

function onTouched(Obj)
    local h = Obj.Parent:FindFirstChild("HumanoidRootPart")
    if h then
        local playertween = TweenService:Create(
            h,
            TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, 0.5, false, 0),
            {CFrame = script.Parent.Parent.wha.CFrame}
        )
        playertween:Play()
    end
end

script.Parent.Touched:Connect(onTouched)
0
I dont get it.. you're tweening the actual player.. is'nt he meant to be like attached to a part on a zipline? sne_123456 439 — 3y
0
You Would Want To Use BodyPosition On The Character. Not TweenService. CallMe_Axis 63 — 3y
0
how do i do that? SirSuperScorpion 27 — 3y

Answer this question