I have watched a tutorial on how to make a sliding script but I want to modify it to be a rolling script.
This is the script I have currently,
local UIS = game:GetService("UserInputService")
local char = script.Parent
local slideAnim = Instance.new("Animation")
slideAnim.AnimationId = "rbxassetid://6674169146"
local keybind = Enum.KeyCode.LeftControl
local canslide = true
UIS.InputBegan:Connect(function(input,gameprocessed)
if gameprocessed then return end
if not canslide then return end
if input.KeyCode == keybind then
canslide = false
local playAnim = char.Humanoid:LoadAnimation(slideAnim)
playAnim:Play()
local slide = Instance.new("BodyVelocity")
slide.MaxForce = Vector3.new(1,0,1) * 30000
slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 50
slide.Parent = char.HumanoidRootPart
for count = 1, 8 do
wait(0.1)
slide.Velocity*= 0.7
end
playAnim:Stop()
slide:Destroy()
canslide = true
end
end)
I do not know too much information about CFrames or BodyGyros so if anybody can help me out it would be appreciatted.
I am guessing the line I have to modify is this one
I’m confused on what you’re trying to do. At the moment your rolling script will send you towards the direction you’re facing, what are you trying to accomplish? Your rolling script will go right and left as long as you’re facing the direction.
Well, I want it to send you strictly to the left, and I want to to send you to the left of your characters look direction(i don’t know if that made sense) but I am guessing that if I try to use CFrame.X it will send you into the left of the worlds direction instead of the left of your character look direction