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

How do I "Instance.new" a Mesh into a "Instance.new"d part?

local cannonBall = Instance.new("Part")

cannonBall.Name = "CannonShot"

-- this is the part i want the mesh in

local Mesh = Instance.new( "SpecialMesh", game.Workspace.CannonShot)

--this is the mesh

1 comment

0

Thanks guys!

2 answers

✓ Accepted answer
--Try this
local cannonBall = Instance.new("Part")

cannonBall.Name = "CannonShot"
cannonBall.Parent = game.Worskapce
-- this is the part i want the mesh in

local Mesh = Instance.new( "SpecialMesh", cannonBall)

--this is the mesh

You have it all correct. What I did was directly input the Mesh inside of the Part. Other parts in Workspace can be named "CannonShot", so it's better to use the variable.

local cannonBall = Instance.new("Part", Workspace)
-- this is the part i want the mesh in
cannonBall.Name = "CannonShot"
--this is the mesh
local Mesh = Instance.new( "SpecialMesh", cannonBall) -- You can input the variable

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