Problem with passing an object to another player

Thanks for going out of the way to read this post.

So I’m making a game about hot potato, and whoever is tagged will have a potato on top of them. The problem is that I have no idea how to put the potato on top of the player who is tagged. Currently, my system is that inside every player who joins is a boolean that determines if whether their tagged is true or false. Assuming that the “potato” being passed around is a Part. how will I go about making such a script?

Feel free to ask me for more details if necessary. Also, I’m not a professional programmer so forgive me if I am confused about many things.

3 Likes

You can use align position & align orientation

Or you can use Motor 6D/ Weld but I faced some killing issues

So I would recommend using align position & align orientation to the potato.

How would I go about using align position and align orientation? I did some searching up, and still have no idea how to use it.

Those are constraints that applies force to move two attachments together. So, you can create an Align Position & two attachments:

local attach0 = Instance.new("Attachment")
local attach1 = Instance.new("Attachment")
attach0.Parent = character.HumanoidRootPart -- player's bodyPart
attach1,Parent = hotPotato -- a part of hot potato
local alignPos = Instance.new("AlignPosition")
alignPos.Parent = hotPotato
alignPos.Attachment0 = attach0
alignPos.Attachment1 = attach1
alignPos.RigidityEnabled = true

This will move the potato to the character.
You can change the CFrame of the attachments & play holding animation to make it look more realistic.

You can use AlignOrentation as well, and it works similar to AlignPosition.

  • Always remember to enable the Rigidity to make the object move as fast as it can to its destination.

The align position works! However, is it normally slow at catching up to the player? I noticed that the “potato” takes a while to keep up with the player as it moves, and the “potato” keeps swirling in circles. Does align orientation solve this? I tried experimenting with it as you said it is similar to align position, but I can’t quite figure out how to work with it.

Edit: I searched up and found out that welds can hold 2 parts together. If the “potato” cannot be sped up to keep up with the player’s movement, should I be using welds instead? (I don’t know how welds work though =\ )