What could be causing the Z value to change out of nowhere?

I am creating climbable ropes, but for some reason the character keeps rotating once it passes the middle.


What could be causing this to happen and how do i solve it?

local PosRelative = ClimbingPart.CFrame:PointToWorldSpace(Vector3.new(CurrentPos.X,0,CurrentPos.Z))

--The rest of the code calculates the position of the character in lookvectors of the newly created cframe
--from PosRelative looking at climbingpart.Position 
1 Like

maybe need to update values while that things position/orientation is changing

other than that, idk because your code doesn’t exactly explain enough.

EDIT: i notice that the spin happens at the same time that the rope reaches its max velocity and comes back down, so i’m assuming the ropes movement is effecting your calculation and you have to take the changes into consideration.

local PosRelative = ClimbingPart.CFrame:PointToWorldSpace(Vector3.new(CurrentPos.X,0,CurrentPos.Z))

–edit figured it out

The issue still happens whenever the rope is moving at an extremely slow speed.

what if the rope isn’t moving at all? and i dont think the speed is effecting it, i think the movement alone is effecting it, your calculations are going off of old values because your not updating them as the rope and player moves. (unless you are somewhere else)

So the way it works is:

Position from objectspace of the part gets saved.

repeat(
SavedPosition gets re-used to calculate everything at the next renderstep.

Position from object space gets saved again.
)

At a lower speed, it still occurs.


However at a really slow speed, it doesn’t show up and i think thats because the rope is going past the middle so fast that it doesn’t have enough time to respond to it.

I had figured out the issue, apparantly the rope calculator was messing it all up.