Tween not working with no errors

basically i need a move part loop that would go in the target position repetivelly, and easy to set up just by adding a vector3 attribute in the object.

if des:GetAttribute("SlowMove") then
		task.spawn(function()
			
			while true do
				wait(1)
				local originalpos = des.Position
				local target = des:GetAttribute("SlowMove")
				
				local success,errorm = pcall(function()
				TweenService:Create(des,TweenInfo.new(1),{Position = target}):Play()
				end)
				
				if not success then
					warn(errorm)
				end
				
				des:SetAttribute("SlowMove",originalpos)
				wait(1.1)
			end
		end)
	end

However it doesn’t show any kind of errors with my pcall function. and the loop is working (testing with print)

have you tried printing at the start of the loop to see if your code is running at all (nevermind im stupid)

image
It does run which is weird

task.spawn(function()

			while true do
				wait(1)
				print("loop running")
				local originalpos = des.Position
				local target = des:GetAttribute("SlowMove")

				local success,errorm = pcall(function()
					TweenService:Create(des,TweenInfo.new(1),{Position = target}):Play()
				end)

				if not success then
					warn(errorm)
				end

				des:SetAttribute("SlowMove",originalpos)
				wait(1.1)
			end
		end)

try printing originalpos and target

it does print

theyre identical, which means it is infact moving, its just moving nowhere

it’s a CFrame and not a position

TweenService:Create(des,TweenInfo.new(1),{CFrame = target}):Play()

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.