Block Stays In Place While Being Anchored (velocity wont even work)


(sorry for video lag)
the video above shows the error

local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()
local RS = game:GetService("RunService")
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local headat = Instance.new("Attachment",script.Parent.Shoot)
local function setpos(SizeX,SizeY,Num)
	local postable = 	{
		Vector3.new(0,SizeY/3,SizeX/3),
		Vector3.new(0,-SizeY/3,SizeX/3),
		Vector3.new(0,SizeY/3,-SizeX/3),
		Vector3.new(0,-SizeY/3,-SizeX/3)
	}
	return postable[Num]
end
Mouse.Button1Down:Connect(function()
	Target = Mouse.Target
	if Target~= nil and Target:IsA("Part") and Target.Anchored == false then
		script.Box.Adornee = Target
		for i,v in pairs(game.Workspace.Beams:GetChildren()) do
			local at = Instance.new("Attachment",Target)
			at.Position = setpos(Target.Size.X,Target.Size.Y,i)
			v.Attachment1 = at
			v.Attachment0 = headat
		end
	end
end)
local tweenservs = game:GetService("TweenService")
local info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0)
local info1 = TweenInfo.new(0.1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0)
RS.RenderStepped:Connect(function()
	for i,v in pairs(game.Workspace.Beams:GetChildren()) do
		local CT0 = tweenservs:Create(v,info1,{CurveSize0 = math.random(-10,10)})
		local CT1 = tweenservs:Create(v,info1,{CurveSize1 = math.random(-10,10)})
		CT0:Play()
		CT1:Play()
	end
	if Target~= nil and script.Box.Adornee ~= nil and Target.Anchored == false then
		CFRAME = script.Parent.Shoot.CFrame
		tween = tweenservs:Create(Target,info,{CFrame = CFRAME*CFrame.new(Vector3.new(25,0,0))})
		tween:Play()
	end
end)
Mouse.Button1Up:Connect(function()
	if CFRAME then
		print(Target.Velocity)
		tween:Cancel()
	end
	for i,v in pairs(Target:GetChildren()) do
		if v:IsA("Attachment") then
			v:Destroy()
		end
	end
	script.Box.Adornee = nil
end)

this is my code and now idk why that happens? i am just using is CFRAME and when i stop holding the mouse it glitches idk why

That’s because the part is anchored.

the part is literally not anchored at all diddnt u saw the video

Bruh, the pqrt is anchored. Set it to false at the beginning of the script.

Target.Anchored = false

how the heck is it anchored see the video

It was anchored then he un-anchored it and it worked fine.

can you please see the video more closely?

I dont get it, he literally sets it to not anchored and the part falls down.

Wait oh u r the author i see.

ill send you a better video wait

https://developer.roblox.com/en-us/api-reference/property/BasePart/Velocity

Velocity is deprecated, if you need to determine the speed of an object then divide its distance between two positions by the length of time it took.

ok thats great i know but WHY DOSENT IT WORK???

Why doesn’t what work? Can you explain the video because I’m unable to watch it.

so what happens is my code makes the part some sort of anchored for some reason idk why but it does you can try my code if u want

Only the tween variables are reset, not the properties being changed by the tween. This means if you cancel a tween half way through its animation the properties will not reset to their original values. Where Cancel differs from TweenBase:Pause is that once resumed, it will take the full duration of the tween to complete the animation.

i see so its cause i cancel the tween right? if so then what do i do?

NVM ill use Tween:Destroy() ok NVM that dosent work either

Hmmm tween:Pause? ignore ignore

i see ill try using tween pause then