Resuming Walk after Context Action bound to W unbound?

Hello, I’m working on a ledge climbing system. It basically works by binding the WASD keys with the ContextAction Service to do the ledge aiming.

The issue I’m facing is that when the player jumps (unbinding said actions), if they were pressing any of the key before jumping, the character will not begin to walk.

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!

Does anybody know any solution to this?

You could override the normal movement inputs, retrieve the player’s input values with the ControlModule, then input those values into Humanoid:Move()

Additionally if you don’t want to worry about having the normal WASD keys being unbound, you could use UserInputService’s InputBegan/Ended events to send inputs to whatever handles your climbing system

local RunService			= game:GetService("RunService")

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

local ControlScript			= require(Player:WaitForChild("PlayerScripts").PlayerModule:WaitForChild("ControlModule"))

RunService:BindToRenderStep("OverrideMovement", Enum.RenderPriority.Character.Value + 1, function()
	local MoveVector: Vector3 = ControlScript:GetMoveVector()
	Humanoid:Move(MoveVector, true)
end)
1 Like

I know I shouldn’t say anything but… please… don’t do vertical alignment… It makes code way harder to read and maintain… :pensive: :pensive: :pensive:

does this perhaps bother you

Actually that’s the most beautiful config file I’ve ever seen. But if you need to add another property to your capsules, it’s going to be agonising

1 Like

Hey, thanks for the reply!
UserInputService is a bit of a hassle for me because I have to be able to bind and unbind these actions from a lot of different scripts, if everything fails though, I’ll have to use it.
Will try and see what the solution is. Thanks! And hats off for having the guts to write vertically aligned code :open_mouth:

1 Like

Well, my solution was a bit different, but it used some of this code so I’ll mark the solution.

Firstly I use override the default movement like you wrote:

I basically unbind the “Override Movement” when the player is climbing, and then just before they stop climbing I rebind it.

And I’m no longer using ContextAction Service, as whenever I did use it to prevent the player from moving, even if I disabled lateral or backwards movement, it paused forward movement as well.
So now I’m detecting input for the climbing system with UserInput Service.

1 Like

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