Skip to content

Api > GameObject > CreatePrimitive()


GameObject.CreatePrimitive(PrimitiveType type)⚓︎

Creates a game object with a primitive mesh renderer and appropriate collider.

Parameters:⚓︎

Name Type Description
type PrimitiveType The type of primitive object to create.

Returns:⚓︎

type Description
GameObject created game object

Usage⚓︎

---@type PrimitiveType
local type;


local val0 = GameObject:CreatePrimitive(type)