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

how could i move the character in this dive script?

Asked by 5 years ago

hey there, i'm trying to make a dive script, like in Mario 64, my script is working fine, but there's a problem. i wan't to the character dive to the torso direction, but i just don't know how to do it! i tried some ways, like changing the torso velocity, and trying to move the player, but doesn't work. please, if you can, help me. srry for bad english

here the main code

-- // code for platformer animations and mechanics // --

-- unfinished

repeat wait() until script

-- variables

sp = script.Parent

humanoid = sp:FindFirstChild("Humanoid")

torso = sp:FindFirstChild("HumanoidRootPart")

UIS = game:GetService("UserInputService")

-- dive

canDive = true

diveStart = humanoid:LoadAnimation(script.diveStart)

slide = humanoid:LoadAnimation(script.slide)

UIS.InputBegan:connect(function(Input)

local MouseInput = Input.UserInputType

local KeyCode = Input.KeyCode

if KeyCode == Enum.KeyCode.C and canDive == true then

canDive = false

humanoid.Jump = true

diveStart:Play()

else

end

end)

humanoid.StateChanged:Connect(function(oldState, newState)

if newState == Enum.HumanoidStateType.Landed then

canDive = true

diveStart:Stop()

end

end)

0
i don't know how to make the "code" thing, andremalaquias 2 — 5y

Answer this question