Why is my platform moving towards the line that appears when I click on the AlignPosition object?

Hello, I am trying to make a platform which will just stay floating in the air doing nothing until a player stands on top of it using AlignPosition. However it just moves on its own rather than stay where it’s at. Here’s a video showing the issue:

Here is my script located in StarterPlayersScripts as a local script:

local Zone = require(game:GetService("ReplicatedStorage").Zone)
local zone1 = Zone.new(game.Workspace:WaitForChild("PlatformMoverZONE"))
local platform = game.Workspace:WaitForChild("PlatformMover1")
local PlayerStateonPlatform = false
	
local StarterPosition = game.Workspace.PlatformMoverPOS1.Position
local Position1 = game.Workspace.PlatformMoverPOS2.Position
	
local delay = 4

platform.AlignPosition.Position = StarterPosition

zone1.playerEntered:Connect(function(player)
	print("player is in zone")
	PlayerStateonPlatform = true
	while PlayerStateonPlatform == true do
		platform.AlignPosition.Position = StarterPosition
		wait(3)
		platform.AlignPosition.Position = Position1
		wait(5)
	end
end)

zone1.playerExited:Connect(function(player)
	print("player is out of zone")
	PlayerStateonPlatform = false
end)

All I want is for it to stay floating there until a player stands on it and not go towards whatever that line that appears is, but rather my own set path that I want. Thank you!

what is the default position of the alignposition

In the properties it is 0,0,0, however the script is setting it to be at the exact position that it starts in before hitting play for testing.

1 Like

turns out it works when I input the part’s position into the AlignPosition’s position in properties, thanks for helping steer me into the right direction and finding out the issue lol

1 Like