Coin Magnet Physics

Hey guys! I am Galactiq, and I am a scripter. I am currently developing a game in which players are able to collect coins by walking through them in order to collect them. I have created a game pass called “Coin Magnet.” Essentially, I want players to be able to walk farther away from the coin, and the coin to move towards the player until it is collected.

That is where you guys come in handy! To be honest, I have no idea how to accomplish this. In my head, tweening sounds great, however when I tween it, it would go to a specific spot, and if the player has moved away from that spot, then the coin would just sit there. I am not asking anyone to tell me what to script, just explain it to me. Explain what possible solutions and steps I could take towards tackling this feature.

If you have any ideas on how I could accomplish the task at hand, please let me know. Thank you so much!

3 Likes

My Suggestion would be to use Magnitude.

I am sorry I did not read the full Post.

3 Likes

You could try lerping it to the Torso or HumanoidRootPart’s CFrame. That was it should always end up directly in them.

I would recommend doing all of the lerping on the client to take unnecessary load off the server. This’ll likely make it smoother as well. There’s lots of articles about lerping on the DevHub and around the forum if you need them. Feel free to post any questions :slightly_smiling_face: .

3 Likes

Have you considered using a RocketPropulsion bodymover?

1 Like