Skip to main content
POST
/
prefab
/
spawn
spawn a named prefab at a position
curl --request POST \
  --url http://localhost:3917/prefab/spawn \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "position": [
    123
  ]
}
'
{
  "entity_generation": 0,
  "entity_id": 9,
  "name": "tower",
  "ok": true
}

Body

application/json
name
string
required
position
number<float>[] | null

Response

200 - application/json

Prefab instantiated from the PrefabRegistry; returns the new entity id/generation. Returns ok:false with an error when the named prefab is not registered.