I made a climbing script and it only works if i face a certain direction. If i were to go behind a part the controls become reversed, and if i go on the sides, it doesn't climb(due to Z and X conflicting i guess)

I have an upvariable(up and down) going -Y(Down) or +Y(Up) I have an sidevariable(left and right) going -X(Left or +X(Right) the variables are looped to have a constant movement rather than tapping it.

if BodyPos then --checking to see if bodypos exists(basically if climbing = true or false)
	BodyPos.Position = Vector3.new(
		BodyPos.Position.X+sidevariable,
		BodyPos.Position.Y+upvariable,
		BodyPos.Position.Z)
end
~

I've messed with character CFrame on the X axis but couldn't get it to work right. I'm probably just missing something small.

Any help is appreciated, thanks.