Skip to reading
GDScript Programming & Godot

CreatePrimitive()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Create Primitive

Create a runtime primitive such as a box, sphere, cylinder, capsule or plane.

Source table from CreatePrimitive(), page 135
Option key / fieldMeaning and inputDefault
Primitive primitiveChoose: box, sphere, cylinder, capsule, plane."box"
ID idText.Blank
XYZ positionDestination/placement coordinates as [X, Y, Z].[0.0, 0.0, 0.0]

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await CreatePrimitive({"primitive": "box", "id": "", "position": [0.0, 0.0, 0.0]})

In use. Spawn a temporary marker for a puzzle demonstration. The normal action form has a small set of fields; detailed dimensions/material settings may need structured data or later property changes supported by the runtime.

CreateProcedural()#

Create Procedural

Create a runtime procedural entity from the requested generator type.

Source table from CreatePrimitive(), page 135
Option key / fieldMeaning and inputDefault
Procedural Type proceduralText.Blank
ID idText.Blank
XYZ positionDestination/placement coordinates as [X, Y, Z].[0.0, 0.0, 0.0]

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await CreateProcedural({"procedural": "", "id": "", "position": [0.0, 0.0, 0.0]})

In use. Use a generator name supported by the engine and check the result in Test Scene. This is not a text-to-model system: an arbitrary description is not a procedural generator ID.

Page 135 of 378Permalink
Go to page