Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago

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

0
Thanks guys! 1nubcaik 62 — 10y

2 answers

Log in to vote
0
Answered by
Adryin 120
10 years ago
--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
Ad
Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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

Answer this question