natiny.model.create
Lua
natiny.model.create([mesh [, material]]) -> model
Creates a model: a mesh instance placed in the scene. A model handle is also an
entity handle, so natiny.entity functions can transform and parent it.
Parameters
| Name |
Type |
Default |
Description |
mesh |
number |
nil |
Mesh handle whose geometry this model places |
material |
number |
nil |
Material handle; without one, the built-in material is used |
Returns
| Type |
Description |
number |
Model handle, also usable as an entity handle; raises an error on failure |
Example
Lua
local box = natiny.model.create(geom, stone)