-
-
Notifications
You must be signed in to change notification settings - Fork 18
instance_create
CryoEagle edited this page Jan 5, 2019
·
2 revisions
Creates object in room
instance_create(position, obj, layer)
Argument | Description |
---|---|
Vector2 position |
Position wher will be object created |
Type obj |
Object to be created |
string layer |
Name of object layer where it should be created |
Returns: GameObject
This function will create GameObject to your choosen layer and position. For example you can create shooting object when press left mouse button.
if (mouse_check_button_pressed(MouseButtons.Left))
{
instance_create(Position, typeof(oPlayer), "Object layer 1");
}
This will create object oPlayer ( need to be located in resources folder ) on Object layer 1 in position where is object with this code.
Back to Instances