How to create Part on Attachment

Hi,I’m GFXBIT!
I had a problem trying to create a Part using Instance.New at Attachment inside my Tool.

What I’m trying to achieve?
Creating Part at Attachment postion.

Tool.
Problem

Local script.
AlsoProblem

You never set the Position/CFrame property of the part. Also make sure collisions are enabled so the part doesn’t fall through the map.

2 Likes

May I ask how to create that? ()-()

1 Like
script.Parent.Activated:Connect(function()
local part = Instance.new("Part")
--dont forgot to add more data!
part.Position = attachment.WorldPosition
game:GetService("Debris"):AddItem(part,5)
end)

Here!

2 Likes

When you create a Part instance “Anchored” is false by default so you don’t need to assign to that property.

2 Likes

And one more thing “game.Workspace” can be replaced with just “workspace” (if you’re lazy like me this is a nice shortcut to use).

1 Like

Thank mate!

What,I never know that!

Okay. :wink: