Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Moving a part to inside another part?

I have a part that I want to place into another part but whenever I change the part's position, it just moves ontop of it.

local part1 = game.Workspace.Part
local part2 = game.Workspace.Part2

function MovePart()
part1.Position = part2.Position -- The part just moves ontop of it :(
end

MovePart()

Help please! :(

1 answer

✓ Accepted answer

Hey again :)

Alright so when you are using properties such as size and position, they will not let parts intersect each other if their property CanCollide is set to true. If you change CanCollide to false, you can make them intersect, however if you want the part to stay CanCollided then you will need to use CFrame.

local part1 = game.Workspace.Part
local part2 = game.Workspace.Part2
 
function MovePart()
part1.CFrame = part2.CFrame
end

 
MovePart()

2 comments

1

Omg thank you so much!

1

no problem :)

This discussion is preserved as it was. New answers, comments, and votes are closed.