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

How do I load a file mesh on a script?

Asked by
NecoBoss 194
10 years ago

I want to use a file mesh and load and asset Id. Here is my current script:

local p = Instance.new("Part")
    p.Position = script.Parent.Position
    Instance.new("SpecialMesh", p)

I want to change this to FileMesh and then load an asset Id. Could someone explain?

1 answer

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

Change the "SpecialMesh" to "FileMesh" and then for the mesh and texture ID, just set it as an asset.

local p = Instance.new("Part", game.Workspace) -- You didn't parent it, just a little tip.
p.Position = script.Parent.Position
x = Instance.new("FileMesh", p)
x.MeshId = "SOMEROBLOXASSET"
x.TextureId = "SOMEROBLOXASSET"
0
Thanks again. NecoBoss 194 — 10y
0
No problem! Sublimus 992 — 10y
Ad

Answer this question