• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

instance

  1. zendraw

    change instance`s object index

    is it good practice to use this function? instance_change(); one of the things that worry me are the facts its not accesable after you run this function and if you try to acceess it it wuld return an error, which is what the manual says.
  2. konkrz

    GMS 2.3+ "sequence_instance_override_object" trouble - object disappears (possible bug?)

    I've just started fiddling around with sequences and they seem to have great potential but in my first try making the simplest thing I ran into a problem. As soon as I start the sequence, the original object instance becomes invisible (as it should) but it doesn't become visible again after the...
  3. K

    Drawing Sprites while game is paused

    Ok, basically. To pause the game i'm making I use the code: if(keyboard_check_pressed(ord("P"))){instance_create(0,0,Pause)} And then, in the create action on Pause instance_deactivate_all(true) But when I do this, every instance Just stops being drawn. How can I pause the game, and still...
  4. S

    GML How i can create and save a variable for every Instances of an objects in one room?

    Hello all. I were thinking about creating and saving (in hdd or etc) a variable for every instance of an object in one room. i have thought about using of id or instance_id but i couldn't make it working. So how i can create and save a variable for every Instances of an objects in one room? For...
  5. T

    GMS 2 Is there a way to get the unique instance identifier? (not ID)

    Hello, I have a decent, but important problem when trying to communicate with unique instances in my game. I could use the ID of course (stored in variable id), but this is not static and changes if I add any nex instances to the layer. There is however this instance identifier thing, for...
  6. Axl Trauts

    SOLVED Get center of every children of Parent_Enemy instance

    Hi, I have a top down shooter and I have this special gun that shoots sticky bombs from above. The should appear at the middle of every enemy instance using its parent par_Enemy. Each enemy has different origins due to their unique behaviors, so using something like this on the script that...
  7. K

    GML Different Dialogue for Different Instances of the Same Object (RPG) SOLVED

    For brevity's sake, I have a a player object, a textbox object, and an interact object. I would like to make each instance of obj_interact contain it's own dialogue ( text[1] = "unique dialogue"; ). I have the obj_textbox set up to read obj_interact's text variable, but then I tried setting the...
  8. jobjorgos

    GML [SOLVED] how to send variables to the unique instance that the object creates?

    I want for each obj_train_cart object to create an obj_inv_block at it own x and y, and that keeps on the x and y also every step after it has been created. But now I get errors that say: variable obj not set when reading it in the step event. What can I do? OBJ_TRAIN_CART Create Event: obj =...
  9. Fleoh

    GMS 2 [SOLVED] Follow an object with his ID.

    Hello guys ! I'm trying to make an object follow an other object thanks to the ids. In fact, the first instance needs to follow the player, the second instance need to follow the first instance, the third the second [...] So i've tried this code : In create event of the object which needs to...
  10. Adriano_ppaula

    (SOLVED) Taking variable from repeated instance to global

    Hey guys ^^ I need help with my game. I'll put a simple example here: I am making an item system in which when the player selects an item he verifies some information about it. global.item_select = (ob_item_sword_01); atk = global.item_select.atk; lv = global.item_select.lv; The problem...
  11. 2

    GML Get Room Properties (Listed Here) of Room You Aren't In

    Is there any way to get room height, instances, instance positions, or instance variables in a room that you aren't in? I was thinking these might be important for procedurally creating the map image in the corner and pause screen for a metroidvania game. I don't think loading every single room...
  12. Tyron Deonarine

    Help with instance.

    Hello, I would like some help. Basically what I am trying to do is breed slimes but the issue is that the child is not breeding with the parent. o_slime1 and o_slime2 is clicked and then o_breed_button is clicked, then o_s_child1 is spawned. Now I want to click o_s_child1 and then either...
  13. BoB3k

    GMS 2 [IDE] Is there a way to search through object instance in rooms?

    So, I'm trying to refactor some of my objects, and this includes renaming and moving around parents and such. One thing I haven't been able to find is a way to search for object instances that have been laid out in the room editor. I know how to do CTRL-Shift-F to find stuff in all of the...
  14. Cupid Stunt

    GML [SOLVED] Get the ids of all touching

    I need an object to be able to determine the specific ids of all instances that are touching its instance. Currently, I use instance_place to tell me if there is a specific type of object below me, but I've found nothing so far that tells me the id of a touching or colliding instance. Anyone...
  15. William Garrison

    GMS 2 Unable to find instance for object

    ERROR: Unable to find any instance for object index '121' name 'fc_content_s1' at gml_Object_flipCombo_Step_0 (line 37) - if (slot_1 == fc_content_s1.fc_content_is) { slot_check_1 = true; } ############################################################################################...
  16. Rowan

    GMS 2 Failing to read an instance's variable

    Currently trying to make it so, when my cursor is over a specific object instance (in this case, an instance of obj_cat), it should print the 'lastname' variable stored in the instance. I think I am having trouble with setting the variable properly, or else the scope is wrong somehow. The...
  17. Coppens

    GML when I choose another instance this one takes the value of the previous one

    Hello, (sorry for my bad English, I'm Belgian) I select an instance, it follows a path, at the end of it I modify a variable of this instance. The problem is that if I select another instance of the object while the first continues its path, when the path is finished, the variable of the second...
  18. R

    (P3DC) Apply collisions for each instance of an object

    Hey there, I managed to set up a 3D collision system using P3DC library, where I have one player and multiple table model objects (.gmmod) which are placed in the map as obj_table objects. Now, the player object's collisions are set up simply like this: collision_player = p3dc_begin_model()...
  19. A

    Taking just one instance from an object

    Hello guys! I have like 30 same object in 1 room and I want to do when I click that object image_index change but when I click all of the 30 instances changing. I want this code for just that instance. How can I do it? Sorry for bad English...
  20. giraffeman210

    Drag And Drop Connecting two instances

    Right now I have a bar spawning at the top of an enemy that follows it. Here is my problem, when I create a second of the same instance the bars only follow the first one instead of each new one having its own bar. Is there a way for an instance to know which instance created it and only follow...
Top