If you enable tween for part, is it possible to reset it in the middle?

Is it possible to prevent the tween part when it has already started to move, by forcible intervention?

		local part = Instance.new('Part')
		part.CanCollide = false
		part.Anchored = true
		part.Size = Vector3.new(20,20,20)
		local tween = TweenService:Create(part,Info,Goals)
		part.Parent = game.Workspace.ForDetection
		part.Position = localPlayer.HumanoidRootPart.Position
		tween:Play()

If, say, a part bumps into another, I need the tween to stop

2 Likes

Assistant | Documentation (roblox.com)
At the last moment, I remembered about the roblox assistant, asked him a question, I advise everyone to use this advice!

local TweenService = game:GetService("TweenService")

-- Create a part to animate
local part = script.Parent

-- Create a tween
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear)
local tween = TweenService:Create(part, tweenInfo, {Size = Vector3.new(5, 5, 5)})

-- Cancel the tween
tween:Cancel()
1 Like

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