CreateEntity()
Syntax
Result = CreateEntity(#Entity, MeshID, MaterialID, [x, y, z])Description
Creates a new #Entity using the specified Mesh and Material. If #PB_Any is used as '#Entity' parameter, the new entity number will be returned as 'Result'.
Valid 'MeshID' and 'MaterialID' can be easily obtained with the MeshID() and MaterialID() commands. #PB_Material_None can be used as 'MaterialID' value, to use the .material script associated to the mesh if the command Parse3DScripts() has been used.
The optionals x,y,z parameters can be specified to set the position of the newly created entity in the world.
If the 'Result' is 0, the #Entity creation has failed. If the #Entity was already created, it is automatically freed and replaced by the new one.
Supported OS
Windows, Linux