I'm trying to make this script move each MoverPart that's spawned use the BodyPosition object to go towards a random object from a table. Whenever I test it in Studio, each part that's cloned only goes towards one object, not a random object.
The MoverPart is cloned using a separate script.
local MoverPart = script.Parent
local CurrentMap = workspace:WaitForChild("CurrentMap")
local CurrentMapGeo = CurrentMap:FindFirstChild("Geometry")
local Content = CurrentMapGeo:GetChildren()
local BodyObject = Instance.new("BodyPosition")
BodyObject.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BodyObject.Parent = MoverPart
ObjectTargets = {}
table.insert(ObjectTargets, Content)
BodyObject.Position = Vector3.new(0, ObjectTargets[math.random].Position, 0)
The rest of the script is not included
