Hello, I am trying to make a system that moves a part to a player’s location. So far I have the character model of the player and am able to locate the player’s location.
I just can’t figure out how to do the actual setting of the part’s position.
One thing I have tried is: script.Parent.Position.Cframe = character.PrimaryPart.Position.Cframe
That doesn’t work but its just an idea of what I am trying to do.
script.Parent.CFrame = character.HumanoidRootPart.CFrame
or change humanoidrootpart to the part that is in the centre of the character
if there is no part in the centre, add a part in the centre
The part will go to the root part of the humanoid. This probably isn’t very useful. If you want it to go into their hand. You can make the part a tool and it will automatically go into the players hand. I hope this helps
CFrame and Position two completely different properties of parts. So, saying Position.CFrame would result in an error. CFrame is not a property of Position, CFrame is simply the rotation and position of a part. You should either stick to CFrame or Position, though I would recommend CFrame. As for it also maintains the rotation of the part, rather than just putting the part at a set position.
You could also just use the HumanoidRootPart like @DybalaplaysYT said, but then again the PrimaryPart of the character is the HumanoidRootPart .
Also, keep in mind the HumanoidRootPart is in the center of the character. So if that’s where you don’t intend the part to go to then I would recommend setting to a specific Body Part of character.