How to make climbing system like a Roblox Deathrun(Or Find Everything) but for r6?

Hello everyone!

Im making a 3d platrformer game, and i want add a climbing system. But all tutorials working buggy with animation glitches or working for all blocks:

EXAMPLE OF ONE CODE FROM TUTORIALS:

local wall = nil
 
local hrp = script.Parent:WaitForChild("HumanoidRootPart")
 
local anim = script.Parent:WaitForChild("Humanoid"):LoadAnimation(script.Parent:WaitForChild("Animate").climb.ClimbAnim)
 
 
game:GetService("RunService").Heartbeat:Connect(function()
    
    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = {script.Parent}
    
    local raycastResult = workspace:Raycast(script.Parent.LeftFoot.Position, hrp.CFrame.LookVector * 1.3, raycastParams)
    
    wall = raycastResult and raycastResult.Instance or nil
    
    if wall then
        
        hrp.Velocity = Vector3.new(hrp.Velocity.X, 20, hrp.Velocity.Z)
        
        if script.Parent.Humanoid:GetState() ~= Enum.HumanoidStateType.Climbing then script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Climbing) end
        if not anim.IsPlaying then anim:Play() end
        
    else
        
        anim:Stop()
    end
end)

And i found video by Chrythm Recreating my favorite wall climb mechanic in Roblox (youtube.com) with climbing system, but with no exaples of code, just result and progress.

Thanks for reading.

2 Likes

I have looked at your script, it is perfect but to do it you must use the CollectionService and tags, I suggest using TagEditor Plugin. Use this modified version of your script (In the CollectionService:GetTagged(“ClimbableWall”) put whatever your tag name is)!

Heres the script:

local CollectionService = game:GetService("CollectionService")

local wall = nil

local hrp = script.Parent:WaitForChild("HumanoidRootPart")

local anim = script.Parent:WaitForChild("Humanoid"):LoadAnimation(script.Parent:WaitForChild("Animate").climb.ClimbAnim)

game:GetService("RunService").Heartbeat:Connect(function()

	local raycastParams = RaycastParams.new()
	raycastParams.FilterDescendantsInstances = {script.Parent}

	local raycastResult = workspace:Raycast(script.Parent.LeftFoot.Position, hrp.CFrame.LookVector  raycastParams)

	wall = raycastResult and raycastResult.Instance or nil
	for i, Part in pairs(CollectionService:GetTagged("ClimbAbleWall")) do -- Put your tag instead ClimbAbleWall
		if Part:IsA("BasePart") and wall ~= nil then
			if raycastResult.Instance == Part then
				wall = raycastResult and raycastResult.Instance or nil
			else
				wall = nil
			end
		end
	end
	
	if wall then

		hrp.Velocity = Vector3.new(hrp.Velocity.X, 20, hrp.Velocity.Z)

		if script.Parent.Humanoid:GetState() ~= Enum.HumanoidStateType.Climbing then script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Climbing) end
		if not anim.IsPlaying then anim:Play() end

	else

		anim:Stop()
	end
end)
1 Like

Sorry, not working. I seted tags to part, but have error with raycastparams amd character not want climb.


2 Likes

I am sorry that my script seemed not to work, but I believe that you have to install the plugin: tag editor; here is the link: https://create.roblox.com/store/asset/948084095

After installing this, you must create a tag and name it “ClimbAbleWall”, then I believe it would work.

Again I apoligize for the inconvenientence, and please reply if there is anything else I could help with! :slight_smile:

By the way, what game are you make? Just out of curiousity. :thinking:

1 Like

i downloaded plugin and seted a tag, but problem with raycastparams.

2 Likes

Let me look into it, ok? I’ll reply tomorrow if that is fine? Could I see your full script?

1 Like

ok man, i can wait 2-3 days or more.

2 Likes

May I ask again to see your full script?

1 Like

But, this is same script. Alright?

2 Likes

Does this help? I just added a few adjustments to your script.

local hrp = script.Parent:WaitForChild("HumanoidRootPart")
local anim = script.Parent:WaitForChild("Humanoid"):LoadAnimation(script.Parent:WaitForChild("Animate").climb.ClimbAnim)

game:GetService("RunService").Heartbeat:Connect(function()
    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = {script.Parent}

    local raycastResult = workspace:Raycast(hrp.Position, hrp.CFrame.LookVector * 1.3, raycastParams)

    if raycastResult and raycastResult.Instance:IsA("Part") then
        hrp.Velocity = Vector3.new(hrp.Velocity.X, 20, hrp.Velocity.Z)

        local humanoid = script.Parent.Humanoid
        if humanoid:GetState() ~= Enum.HumanoidStateType.Climbing then
            humanoid:Move(Vector3.new(0, 0, 0)) -- Stop other movement
            humanoid:ChangeState(Enum.HumanoidStateType.Climbing)
        end

        if not anim.IsPlaying then
            anim:Play()
        end
    else
        anim:Stop()
    end
end)
2 Likes

Thank you, dude! Script working. And also thanks for @The_codeMachine for tag plugin.

1 Like

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