instance_create

From ENIGMA

Jump to: navigation, search


Notation

instance_create(x,y,obj)

Description

Creates and instance of the given object at the specified location, returning its ID.

Parameters

  • x, y: Coordinates at which the object will be placed.
  • obj: The ID of the object to be instantiated.

Return Values

Returns the ID of the instance that was just created, allowing you to manipulate or track it.

Example Call

int part = instance_create(x,y,obj_particle); // Create a new instance of obj_particle at our position (x,y), storing its id in `part'
a.direction = random(360), a.speed = 5 + random(7); // Set the new particle's velocity randomly.
Personal tools