I understand you can hold W key to move up, and S key to move down. A + D keys though, when I try to manipulate the direction the players moving while climbing like this:
Root.Position + Vector3.new(1,0,0)
Sometimes it will move my player backwards instead of right/left on wherever I’m climbing. How do I fix this?
That sounds like it should work, since youre doing object to world orientation, but for some reason it just flings me when I set the position to that. Here’s an example of how that part looks:
if Part then
local up, left, down, right
if UIS:IsKeyDown(Enum.KeyCode.W) then
up=1
end
if UIS:IsKeyDown(Enum.KeyCode.S) then
up=-1
end
if UIS:IsKeyDown(Enum.KeyCode.A) then
right=-1
end
if UIS:IsKeyDown(Enum.KeyCode.D) then
right=-1
end
BP.Position = Root.Position + Root.CFrame*Vector3.new(right or 0,up or 0,0)
else
Hum.AutoRotate=true
PlayerClimbing=nil
BP.Parent=nil
RS:Disconnect()
end
Do Root.Position += Root.CFrame:PointToObjectSpace(1,0,0)
The previous code you had moved you differently because it didn’t care where you were and where you looked, this on the other side takes in account your orientation too.
Exp:
X = LookVector.X * 1, Y = LookVector.Y * 1, Z = LookVector.Z * 1
Adding a CFrame’s LookVector to itself would produce a CFrame moved forward in whichever direction the CFrame is facing by 1 unit.
It will move the part based on x,y,z axes from where it’s looking at.
I adjusted my script so it checks if youre moving every 5 seconds to see if it’s another problem but when i climbed it attached me to the wall, however after 5 seconds the positioning was random.
That’s because it’s not moving you smoothly. If you want to fix it you’ve to redesign the moving system of roblox/use parts they used to make characters move.