So, I have a part I want to clone and I want to position it inside another part and have that same part's rotation. Here's an example:
local clone = game.Workspace.Part:Clone() clone.Parent = game.Workspace clone.Position = Vector3.new(game.Workspace.Part2.Position) clone.Rotation = Vector3.new(game.Workspace.Part2.Rotation)
Doing the above won't work, because it doesn't change the rotation and the position of the cloned part is above the part I want it to be in, not inside. Can anyone help me out?
You just need to use CFrame, as it preserves rotation and allows objects to move through other objects.
Format:
part1.CFrame = part2.CFrame
Edit: exact code I used
local clone = game.Workspace.Part:Clone() clone.Parent = game.Workspace clone.CFrame = game.Workspace.Part2.CFrame