Is this a BUG? My part can't touch when tween and anchored

Hi everyone,

I’m currently working on a project in Roblox where I want to smoothly move a part and have it interact with other parts it touches along the way. However, I’ve encountered an issue when using tween animations and anchoring the part during the animation process.

The reason for anchoring the part is to achieve smoother animations. Without anchoring, there seems to be some jittering caused by gravity, even when using massless or setting the density to 0.

The problem I’m facing is that when the part is anchored, it no longer generates touch events with other parts. Once I remove the anchor, the part can touch other parts again, but the touch results are quite strange. The part shouldn’t be colliding with the spawn location, yet it seems to behave unexpectedly.

I have created a video to demonstrate the issue. Please take a look:

here is my server script in my part:

local part = script.Parent

local ts = game:GetService("TweenService")

ts:Create(part, TweenInfo.new(15), {
	CFrame = part.CFrame - Vector3.new(100, 0 ,0)
	
}):Play()

part.Touched:Connect(function(op)
	print(op)
end)


Has anyone else encountered a similar problem while using tween animations and anchoring a part? If so, I would appreciate any insights or suggestions on how to resolve this issue.

Thank you in advance for your help!

2 Likes

I think you can’t use Vector on CFrame.
Change to this

ts:Create(part, TweenInfo.new(15), {
	CFrame = part.CFrame * CFrame.new(-100, 0 ,0)
	
}):Play()

For the jittering, set the part’s Network Owner to nil (server).
Tweens are forced to ignore physics and will tween straight to the destination. To have it collide, I suggest using AlignPosition AlignPosition | Documentation - Roblox Creator Hub.
Hope this helped!

thank you for advice!I tried but it performed the same.

and CFrames can be calculated with Vectors, your solution and mine has actually the same result.

image

about CFrames, you can check roblox documents here:

1 Like

thanks very much!
But I has a question now that if I didn’t do anything on parts’ network owner, will it’s owner be the server by default?

I’ll try align position later and if it works I will reply as soon as possible, thanks again!

No. It’ll be set to the nearest player. Anchored parts are automatically have their network owner set to the server.

1 Like

A part needs to have physics to generate .Touched events, as those are handled by the physics engine, so Anchored parts don’t generate .Touched events.

As other people said, you need to use an AlignPosition to use the physics engine to move parts in order to use .Touched. This comes with the added benefit of any players standing on top of the part moving along with it.

Thank you so much for helping me find the key sentence in the Roblox documentation. I never knew about it before. (The documentation is too long for me to read, and my English isn’t very good.)

1 Like

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