local function S()local S=movingPart.Position local e=nil if isAtEnd==false then local S=projection.Position else local S=projection2.Position end local z=(e-S).Magnitude isAtEnd=not isAtEnd local l=TweenInfo.new(z/moveSpeed,Enum.EasingStyle.Linear)local E=TweenService:Create(movingPart,l,{Position=e})E:Play()end

local function moveTowardsProjection()
	local startPosition = movingPart.Position
	local endPosition = nil
	if isAtEnd == false then
		local endPosition = projection.Position
	else
		local endPosition = projection2.Position
	end

	local distance = (endPosition - startPosition).Magnitude
	isAtEnd = not isAtEnd


	-- Créer une interpolation Tween pour déplacer MovingPart vers Projection
	local tweenInfo = TweenInfo.new(distance / moveSpeed, Enum.EasingStyle.Linear)
	local tween = TweenService:Create(movingPart, tweenInfo, {Position = endPosition})

	-- Démarrer l'animation
	tween:Play()
end
