Need some help with a visual effect

https://gyazo.com/29fc29eb3aa15b49841715c101965612
How would i replicate this effect perfectly in terms of code? Don’t spoonfeed me, just give me some tips please.

  1. Use tweenservice
  2. You’ll need to know how CFraming works
  3. You’ll need to know how to CFrame a part to another part’s CFrame

I hope this helps

i already know this and have tried this soloution, but sadly it is not a soloution.
Tweenservice wont catch up to the magnet in time, this is because it strictly goes to a singular point, even tho if i update the cframe like 100 times a second it won’t look smooth enough.

What do you mean by ‘Catch Up’, you can speed up tweenservice it has a property allowing you to do so. It also has a Completed property to tweening tracks that you can yield to wait before making the part disappear.

i know, but it won’t go to the magnet if you’re moving, it’ll go behind you.

In that case when you’re in range you’ll want to use a loop or something repetitive so it updates the cframe to whatever part you want it to follow. But only activate this when they’re near the part and make sure to disconnect or break whatever repetitive code you use after it’s gone.

this wouldn’t be near smooth enough, i’m sorry but i’ve tried this already (looping it around 100+ times a second)

I don’t know what else to tell you then, because that’s all the example you sent is. If you’re not doing it on the client, then that’s why your cframing doesn’t look smooth.

i’m doing it on the client, i’ve tried lerping and some bodymovers (bodymovers seem to be the best, but alignposition just flies past the magnet when it’s too fast.)

Can you show an example of how it looks? Does it stutter?

in my code rn there’s a alignposition but it just goes past, tweenservice just goes behind, lerping is too slow. Bodyposition will go behind you.

Can you show your code, and a video to go with it of what’s happening?

all i can show you right now is the alignposition as that’s what i’m trying to test rn
https://gyazo.com/d5bafa9eff05a0fd6da5570522beea1d
This is with like a bad magnet, but it looks fine.
https://gyazo.com/7ef867d73d278d12c289faf51ea5cc20
This is it with a good magnet, it isnt smooth.


						
						local tool = v.Owner.Value.Character:FindFirstChildOfClass("Tool")
						local tickA = tick()
						local align = Instance.new("AlignPosition")
						align.Attachment0 = coin.sparkle
						align.Attachment1 = tool:FindFirstChild("Collect", true)
						align.RigidityEnabled = false
						align.MaxForce = 2000
						align.MaxVelocity = tool.STATS.Range.Value * 4
						align.Parent = coin
						coin.Anchored = false
						coin.Massless = true

						local beam1, beam2 = game.ReplicatedStorage.beams.Basic:Clone(), game.ReplicatedStorage.beams.Basic:Clone()
						beam1.Parent = tool.Handle.Tips.beam1
						beam1.Attachment0 = tool.Handle.Tips.beam1
						beam1.Attachment1 = coin.sparkle
						beam2.Parent = tool.Handle.Tips.beam2
						beam2.Attachment0 = tool.Handle.Tips.beam2
						beam2.Attachment1 = coin.sparkle
						
					repeat 
						game:GetService("RunService").Heartbeat:Wait()
						shouldspin = false
							cointween:Cancel()
						align.Responsiveness = (coin.Position-tool.Handle.Position).magnitude*5
					until v == nil or tick()-tickA >= 1 or v:FindFirstChild("DidThingy")
					

The repeat is to speed up the responsiveness while it goes closer to you.

From the video gif you sent you’re destroying the coin before it actually reaches the front of the position. Maybe you could try adjusting the force of the alignposition so it goes faster because the problem is that it’s too slow and doesn’t finish the transition you’re wanting before it is destroyed.