LocalScript cannot Move Part Created By Server

Hello everyone, I am trying to move a part with a local script, using a bodyPosition. I am using a localscript because I don’t want it to lag. The localscript is located inside starterPlayerScripts. This is the contents of the localscript.

local RunService = game:GetService("RunService")

local dough = game.Workspace:WaitForChild("ChefDough")

local bodyPosition = Instance.new("BodyPosition")
local bodyAngularVelocity = Instance.new("BodyAngularVelocity")
local bodyGyro = Instance.new("BodyGyro")

bodyPosition.Parent = dough
bodyAngularVelocity.Parent = dough
bodyGyro.Parent = dough

bodyPosition.Position = dough.Position
bodyPosition.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyPosition.P = 10000000000000000000000
bodyPosition.D = 100000000000

bodyAngularVelocity.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
bodyAngularVelocity.AngularVelocity = Vector3.new(0, 2, 0)
bodyAngularVelocity.P = math.huge

bodyGyro.D = 500
bodyGyro.MaxTorque = Vector3.new(0, 0, 0)
bodyGyro.P = math.huge

dough.Anchored = false

local function move()

	while true do
		for i = 0, 50, 1 do
			bodyPosition.Position = bodyPosition.Position + Vector3.new(0, 0.3, 0)
			RunService.RenderStepped:Wait()
		end
		for i = 0, 50, 1 do
			bodyPosition.Position = bodyPosition.Position + Vector3.new(0, -0.3, 0)
			RunService.RenderStepped:Wait()
		end
	end


end

move()

The localscript is not returning any warning or error.

The dough is not even moving, what could be the problem? Thanks :slight_smile: