CFrame:PointToObjectSpace() not working as it should

Hello,so I have this doors that opens according to where you at, and I used CFrame:PointToObjectSpace()
So what it’s doing:
But sometimes is not working right here’s code:

		local Position = v.Moving.Door.CFrame:PointToObjectSpace(Player.Character.HumanoidRootPart.Position)
		if v.Open.Value == false then
			v.Open.Value = true
			if Position.Z > 1 then
					v.Moving.Primary.Motor.DesiredAngle = 1.4		
					v.Moving.Primary1.Motor.DesiredAngle = -1.4	
				elseif Position.Z  < 1 then

					v.Moving.Primary1.Motor.DesiredAngle = 1.4	
				v.Moving.Primary.Motor.DesiredAngle = -1.4
		elseif v.Open.Value == true then
				v.Moving.Primary.Motor.DesiredAngle = 0
				v.Moving.Primary1.Motor.DesiredAngle = 0
				v.Open.Value = false


It’s doing exactly what you programmed it to do. PointToObjectSpace isn’t the problem.

Other than this comment, not quite sure if I can adequately help you here. Do you have a reference or way to visualise what’s occurring here? That’ll be beneficial to helping you see where things are going, if you’re at an absolute loss for how to do this.