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!