Sliding system doesn't work

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    My dash like in roblox grace sliding system doesn’t work, character stays in place and doesn’t move

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character : Model = Player.Character or Player.CharacterAdded:Wait()
local Humanoid : Humanoid = Character:WaitForChild("Humanoid")
local Animator : Animator = Humanoid:WaitForChild("Animator")


local UIS = game:GetService("UserInputService")
local RepStorage = game:GetService("ReplicatedStorage")
local Tweenservice = game:GetService("TweenService")

local Anim = RepStorage.Animations.Slide

UIS.InputBegan:Connect(function(Input, gameprocess)
	
	if gameprocess then return end
	
	if Input.KeyCode == Enum.KeyCode.Q then
		local LoadedAnim : AnimationTrack = Animator:LoadAnimation(Anim)
		LoadedAnim.Looped = false
		LoadedAnim:Play()
		
		local velocity = Instance.new("LinearVelocity")
		velocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
		velocity.ForceLimitMode = Enum.ForceLimitMode.PerAxis
		velocity.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
		velocity.VectorVelocity = Vector3.new(0, 0,-500)
		velocity.Attachment0 = Character.HumanoidRootPart.RootAttachment
		velocity.Parent = Character.HumanoidRootPart
		velocity.MaxForce = math.huge
		velocity.Enabled = true
		
		local Info = TweenInfo.new(10, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
		
		local SlowingDown = Tweenservice:Create(velocity, Info, {VectorVelocity = Vector3.zero})
		
		
	end
end)
1 Like

Is it a dash in one direction or is it supposed to be changing? Also, you the tween don’t play at all

I will implement the tween after. The dash is like in the strongest battlegrounds so it moves with your camera

Oh sure. Lemme see whats wrong w it and maybe edit it a bit if I see issues hard to explain. So you want a dynamic dash as well huh

So it was weird and I had to re-write some parts because they didn’t make sense to me.

Try this (Untested):

local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RepStorage = game:GetService("ReplicatedStorage")
local Tweenservice = game:GetService("TweenService")
local Debris = game:GetService("Debris")

local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAppearanceLoaded:Wait()

local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator")
local HRP = Character:FindFirstChild("HumanoidRootPart") :: BasePart
local RootAttachment = HRP:FindFirstChildOfClass("Attachment")

local Anim = RepStorage.Animations.Slide

UIS.InputBegan:Connect(function(Input:InputObject, GPE:boolean)
	if GPE then return end
	if Input.KeyCode ~= Enum.KeyCode.Q then return end
	
	local LoadedAnim = Animator:LoadAnimation(Anim)
	LoadedAnim.Looped = false
	
	local Vel = Instance.new("LinearVelocity")
	Vel.Attachment0 = RootAttachment
	Vel.MaxForce = math.huge
	Vel.VectorVelocity = HRP.CFrame.LookVector * 50
	Vel.Parent = RootAttachment
	
	LoadedAnim:Play()
	Debris:AddItem(Vel, 0.5)
end)

It doesn’t have the camera thing yet so its a static dash

1 Like

The point of it was that it goes where i look even if i turn my camera

What do you mean it goes where you look? In the code you want the character to dash 50 units away from where the HRP is facing.

For most dashes, the direction in which they dash in are the same. What he wants is for the direction of where the players camera is be used to control the dash control. I personally didn’t include it because I would’ve been spoon feeding

Yeah, I get what he means but can’t you just include the look vector of the camera then?

Just if i make it velocity.VectorVelocity = Vector3.new(0, 0,-50) It will push my character always forward to the front of humanoid root part

The issue was resolved by me, I already completed the whole system i wanted to make, closing this post.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.