Why isn't this script for Prismatic Constraint working?

So i’m making an Obby where i want a platform to repeat the action of sliding between 2 positions. Initially i used TweenService until i realized players fell of the platform then i was introduced to Prismatic Constraints. I am also having trouble understanding Target Position so if someone could explain it would be helpful.

Script(Inside Part):

local slide = script.Parent.PrismaticConstraint

while true do
	if slide == nil then return end
	slide.TargetPosition = 95
	wait(2)
	slide.TargetPosition = 5
	wait(2)
end

Explorer(Properties of Prismatic Constraint)


All help is appreciated thank you!

Are your parts anchored? From testing, make sure that the part with the Attachment0 child is not anchored, while the part with Attachment1 is anchored.

To your question about TargetPosition, that seems to be the offset between the attachments in studs.

Thankyou you just saved hours of test and trials lol