I’m making a climbing system and am using the Humanoids MoveVector to determine which animation should be playing when climbing (up, left, down, right) but if you change from climbing one side of a part to another side, the animations invert because MoveVector’s X and Z Change.
Is there a way to fix this or easily tell the difference?
if math.round(self.Humanoid.MoveDirection.X) == -1 and self.ClimbingAnimation ~= self.ClimbingUp then
self.DirectionChange = true
self.ClimbingAnimation = self.ClimbingUp
print("UP")
elseif math.round(self.Humanoid.MoveDirection.X) == 1 and self.ClimbingAnimation ~= self.ClimbingDown then
self.DirectionChange = true
print("DOWN")
self.ClimbingAnimation = self.ClimbingDown
elseif math.round(self.Humanoid.MoveDirection.Z) == 1 and self.ClimbingAnimation ~= self.ClimbingLeft then
print("Left")
if math.round(self.Humanoid.MoveDirection.X) == 0 then
self.DirectionChange = true
self.ClimbingAnimation = self.ClimbingLeft
end
elseif math.round(self.Humanoid.MoveDirection.Z) == -1 and self.ClimbingAnimation ~= self.ClimbingRight then
if math.round(self.Humanoid.MoveDirection.X) == 0 then
print("Right")
self.DirectionChange = true
self.ClimbingAnimation = self.ClimbingRight
end
end