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!