Tweening Position is extremely glitchy?

I’m tweening a part and its phasing through the table and being very glitchy, as the video shows:

External Media

Here’s my code for this. I’m using a placeholder part for now by instancing.

	for i, v in grid do -- per row
		for k, x in grid[i] do -- per column
			if grid[i][k] == 1 then
				local piece = board:FindFirstChild(tostring(i) .. tostring(k))
				if piece then
					local token ="Part")
					token.Parent = board
					token.Size =,0.5,0.5)
					token.Name = "token"
					token.CanCollide = false
					token.CanTouch = false
					token.CanQuery = false
					token.Anchored = false
					token.Position =, originpoint.Value.Y + spacedistance.Value, originpoint.Value.Z)
					local twinfo =, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
					local goal = {CFrame = piece.CFrame}
					local tokentween = ts:Create(token, twinfo, goal)
					token.Position = piece.Position
					token.Anchored = true

Any help would be greatly appreciated!

1 Like

I’ve noticed that extra “tokens” have been created, which is quite strange. This might be why it looks glitchy…

1 Like

Did some more testing, and it appears that there are 3 tokens on row 6, column 1, 2 tokens on row 6, column 2, and 1 token on row 6, column 3.
There is only meant to be 1 in each of these places.
I doubt that this is the reason this is happening…
Also, half the time the part doesn’t even spawn in :confused:

OK, the reason why the tokens were appearing multiple times is because the bindable event I was using was fired 3 times, 1 for each update, which is why they were distributed in the way they were. To fix this, I fired the event at the end of the full update.
I fixed the part not instancing in too.
This still doesn’t fix the glitchiness.
Changing the twinfo settings doesn’t do anything either…

When Tweening the CFrame of a Part, it’s recommended to Anchor the Part first to stop physics being applied (which is causing the glitching).

token.Anchored = true
1 Like

What a simple solution!
Thanks a lot, it was much easier than I initally thought. I was under the impression that anchoring it would cause the tween to not run.

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