Kicked out of seat upon motion Please Help

I am currently making a ride for a park and when I start the ride I get kicked out of the seat and the ride goes on, I have tried to get in the seat after the ride started but it still kicks me out. I want to be able to sit in the ride the full duration with no problem I have tried to change the script up a little, but I am new to scripting, so I am confused on what to try


local ClickDetector = script.Parent.Parent.balls.ClickDetector -- This is so my button activates it 

script.Parent.PrimaryPart = script.Parent.Primary

ClickDetector.MouseClick:Connect(function()
	
	wait(0)

	local function Move (x,y,z)
		for i=1,700 do 
			script.Parent:MoveTo( script.Parent.Primary.Position + Vector3.new(x,y,z)) -- Is this correct? or why is it kicking me out of my seat when i hit the green button 
				
			
					wait(0.01)

		end
	end
	Move(0,.35,0)
	wait(15)
	Move(0,-.35,0)	
end)


Try directly changing the CFrame like script.Parent.PrimaryPart.CFrame = newCFrame instead of using MoveTo or PivotTo for moving vehicles.

What did i do wrong here because this doesnt work


local ClickDetector = script.Parent.Parent.balls.ClickDetector
local Main = script.Parent

script.Parent.PrimaryPart = script.Parent.Primary

ClickDetector.MouseClick:Connect(function()

	wait(0)

	local function Move (x,y,z)
		for i=1,700 do 
			
Main.PrimaryPart.CFrame.Position = CFrame.new(0,50,0)


			wait(0.01)

		end
	end
	Move(0,.35,0)
	wait(15)
	Move(0,-.35,0)	
end)






I would appreciate if you provided more information, such as errors in the output and the context of code. Providing only a snippet of code is not going to help other people solve the issue.

If you did a test run now, the error might say “expected Vector3, got CFrame”. This is because you are trying to set a CFrame on the Position, when it should be a Vector3.

However, my proposed solution does not require Vector3, so you can remove the CFrame.Position = newCFrame, and change it to CFrame = newCFrame.

I FIXED IT BUT!!! There is another minor issue… SO I’m building a theme park. and my ride idk if you have ever seen windseeker but it’s at Kings Island, Cedar Point and a few other parks. I have everything script wise done for the up and down function. But I have a green button to start the ride, after I press it, it goes up and comes back down as intended but then without pressing it again it goes back up and down forever. I want it to stop after one go and make it to where you have to press the button for the ride to go again. Do you know what’s wrong here? (I assume it has to do with the while true do)

`workspace.Tower.Main.PrimaryPart = workspace.Tower.Main.MainPart

local ClickDetector = script.Parent.Parent.balls.ClickDetector

ClickDetector.MouseClick:Connect(function()

end)
wait(15)
while true do
for i = 1,520 do
wait(.01)

	workspace.Tower.Main:SetPrimaryPartCFrame(CFrame.new(workspace.Tower.Main.PrimaryPart.Position + Vector3.new(0,.5,0)))
end
wait(18)

for i = 1,520 do
	wait(.01)

	workspace.Tower.Main:SetPrimaryPartCFrame(CFrame.new(workspace.Tower.Main.PrimaryPart.Position - Vector3.new(0,.5,0)))
end
wait(2)

end

`

`