instance_create

  1. andev

    Imagine if the create event could take arguments

    Perhaps this is the wrong place for this but I would love to start a discussion, even if it never gets implemented. But yeah, imagine if you could do instance_create(obj, arg0, arg1) etc. And then the create event could look like: x = argument0; y = argument1; Or even if the arguments started...
  2. E

    SOLVED Problems with a code

    Hello, i speak spanish so my english is very bad,i have a problem, i wanna make a shooter game and i cant. Because "instance_create" its variable and not a function. i see tutorials and forums, and they have "instance_create" in orange. Hola, hablo español así que mi ingles es bastante malo...
  3. sinigrimi

    GMS 2 [solved]removal from instance_create script if the object was destroyed

    Hello! When I enter the room, it reproduces the blocks, but when I move to the next and return to the first, nothing is reproduced in it :( p.s .: rooms are not from GM but are generated in the same GM Room after moving outside the camera. I would also like to know if I can mark these objects...
  4. splendidtank

    HTML5 Intance_create not working

    The instance_create_layer function is not working my code is: if (instance_exists(oPlayer)) && (point_in_circle(oPlayer.x,oPlayer.y,x,y,64)) { nearby = true; if (keyboard_check_pressed(ord("Q"))) && (!instance_exists(oGunPickup)) && (!instance_exists(oGun)) { image_index =...
  5. W

    how do i create a instance

    i am trying to make a top down shooter in gml, i've made all the movement and rotation but i don't know how to make the player shoot, i saw tutorials online and all of them said to use the function "instance_create" but every time i use that it just says it is a variable and it says nowhere that...
  6. Corey

    (Fixed)Global variable/Alarm/instance_create issue

    Edit: Disregard. I fixed my problem by adding a Step event with global.enemyCounter = currentEnemies; to check the counter every frame and switched my Alarm event code to check conditions before spawning an enemy. Hello all. I have tried countless times to fix my problem. I am somewhat...
  7. M

    "Instance_create_depth" bug/annoying thing

    Hey, Recently I've been working on my own boss A.I., but I've encountered an annoying problem. Whenever I try to use the function "instance_create_depth" on my bot, on the first frame the instance that it creates spawns in the wrong coordinates which makes it look bad. I've tried many things to...
  8. Z

    GML Instance_create sometimes works and sometimes doesn't

    Hello, I completed the traffic spawning system in my GTA 2 style game, and it worked, but after a bit it stopped. The way it works is it checks the player distance, and then creates a car, and then a pedestrian in the car to drive it. Problem is, the pedestrian only spawns about 20% of the time...
  9. O

    Instance_create no longer accepts variables

    The code is essentially: (during attack frame) { var damage = instance_create(x,y,obj_damage) damage.creator = id; damage.attack = 5; } (in the damage objects create event) z = creator.z; The game crashes and gives me "<unknown object> <unknown variable> "creator" "z" error
  10. N

    Need Code Help

    Hello GMC, could anybody please help me with something. How do you create an object with variable set to that object say for example if the code below existed: key press Z instance_create_var(x,y,item,var1 = 0 | var2 = 0 | var3= 0) This is the best way I can think to explain it sorry :) Please...
  11. D

    Windows Instance_create does not work in the windows test game, but works perfectly in the HTML5 version

    I made a game with a quick intro, the end of the intro is supposed to create an object I tested this a couple days ago, worked perfectly, no problems in windows or HTML5 Today I made a second room to do some testing, after I finished testing, I deleted that room Now HTML5 spawns objects, but...
  12. H

    Legacy GM instance_create doesn 't work

    I am trying to create a button that when pressed creates a GUI on the side of the room. for the GUI to be interactive, i made buttons (obj_more, obj_less) wich should spawn when the button is pressed. But when I try the code I also used for another button (wich worked) it didn 't work. I also...
  13. chaslinux

    Legacy GM [Solved] Moving right to left

    In an alarm[1] event called obj_ufospawner I have the following code: // set the direction of the UFO var ufo_dir = irandom(1); var x_start = 0; // set the x start point var y_start = random(400) + 60; // set the y start point if (ufo_dir == 0) { direction = 0; // go right x_start =...
  14. S

    GMS 2 Collisions with 2 objects created with instance_create

    I have hurtbox and hitbox objects that are created around enemies and the player in my game, using instance_create_depth(). And that's fine, for the most part, except that when a hitbox is created, I need some way of registering a collision with the hitbox, and the hurtbox (like a collision...
  15. S

    GMS 2 Editting the properties of an object created with instance_create

    I have a hitbox I create in an attack state for the player. Here is my code: bodyHitbox = instance_create_layer(x + 450, y, layer, obj_body_hitbox); object_set_solid(bodyHitbox, true); bodyHitbox.mask_index = spr_player_attack_1_body_hitbox...
  16. csanyk

    Asset - Scripts InstanceCreate

    InstanceCreate is my first Marketplace asset for GMS2. I created it mostly as an exercise to make sure I knew how to create assets for GMS2, and also to "fix" a mild annoyance I have with the instance create functions in GMS2. This is a very simple script for GMS2 users who came from GMS1, and...
  17. E

    instance_create(x, y, obj) without coordinates?

    Is it possible to create object without specifying x and y? The matter is that obj_warrior can be spawned within (x:100, x:200) while obj_archer can be spawned within (x:0, x:100); The available spawn range for each sprite is supplied as their properties (rangeXstart, rangeXend). But I can't...
  18. P

    instance_create Help!

    I was following a space shooter tutorial and in the video they used a code similar to instance_create(room_width+40, randY, Enemy); I found out GameMaker removed instance_create to instance_create_depth or layer but when i tried the new code it says "number of arguments expected 4 got 3. whats...
  19. M

    Randomness in timelines

    So I've been making some kind of randomized-Bullet-Hell type of game, and not too complex of course since it is my first time using code and GameMaker. I'm using a timeline to create all of the bullets and the instances, which work well, except for one detail: No many times how I restart my...
  20. Y

    Legacy GM instances not getting created

    hello, first of all bear with me because this is probably going to be long. so I'm trying to make my wave system work. first I've set some variables in the create event: Last_Pause = 0 //how many times the spawner spawned enemies in 1 wave( a wave is split into 5) global.Wave = 0 //current...
Top