Help with making a wall climbing system using Humanoid.MoveDirection

Hi there, I’m currently revamping my wall climbing system. My old code relies on user input (Keys like WASD), I’m wanting to add mobile support into my game, so that’s why I chose humanoid.MoveDirection (because it picks up the joystick).
My old code:

local controls = {0, 0, 0, 0}
local keys = {"A";"D";"W";"S"}
local movement = hrp.CFrame:VectorToWorldSpace(Vector3.new(controls[2] - controls[1], controls[3] - controls[4], 0)) * 35
-- Set body velocity

It works fine, I tried to implement humanoid.MoveDirection like so

local movement = hrp.CFrame:VectorToObjectSpace(Vector3.new(hum.MoveDirection.X, hum.MoveDirection.Z, 0))

The problem is that it isn’t relative to the hrp.CFrame (I think), thus when I try to climb, the vector3 value differs for each sides I’m climbing on. I have also tried VectorToWorldSpace but the issue still remains.
Any help is appreciated!

guys help ;-;… no idea on how to fix this one, maybe I should just create buttons on mobile using context action service

Have you tried searching the forums for ‘wall climbing’? There are quite a few posts there and one of them may help you out.

Yes I have, pretty much the majority of them is about PC and keys on the keyboard, not on mobile.

1 Like