• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

instance

  1. 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; } ############################################################################################...
  2. R

    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...
  3. C

    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...
  4. 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()...
  5. 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...
  6. 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...
  7. 2

    GMS 2 Tilemap Array Loses Place when Sprite Based Instances in Room

    There seems to be a bug with tilemap ids, but I'm not sure. When I add visible instances with sprites to my room I get the name of the background instead of a tilemap in spite of the fact that I use "if layer_get_element_type(a) == layerelementtype_tilemap" before adding the name and id of the...
  8. Axl Trauts

    Different x y positions on several instances of same object

    Hi, I am trying several things for this with no luck yet. I created a shop, where you can buy 1-4 wingmen for the player (a plane). They will go to their respective position: two on the left, one behind the other and the other two on the right, one behind another, like a V formation. When the...
  9. Architheutis

    Givin´ the instance another hsv (SOLVED!)

    Hi Folks, a little queston: I have certain levels in night ambience. Therefor I changed my player-instance`s hsv in that level, manually. But naturally, if my player gets assgrabbed by enemies or harmful objects, the k.o.-animation and the reanimated player idle don´t keep the manually...
  10. William Garrison

    Parallax on Instance Layer

    Whats up gang! Obligatory "I am new to GML", but I have a question that I am hoping there is a simple answer for. I am setting up Parallaxing for my Side Scroller Game and it works great for the "Background Layers" but I want to also be able to apply it to Standard Instance layers. The code that...
  11. F

    GML how to store multiple kinds of instances with their x and y coordinate

    basically what I'm trying to do is make it so that when the player presses Z, each instance of every object parented to a parent object is stored but is no longer in the room and a new setup is drawn, and when the player presses Q, the new setup is stored and the old one is shown and i need to...
  12. I

    GMS 2 How to set variables for clones of the same object?

    So I am working on a fighting game, and in it (of course) I want to have two players to fight against eachother. The problem is that I have 2 instances of the same object and they both use the same controls. How do I make them have separate "moves"? (I would give some code but I have no clue on...
  13. Suzaku

    GMS 2 How to apply code to only the first instance of an object?

    I have a character object in a room and a copy of the same object in the same room. When I move him to the sides both the original and the copy move together. In that case I would like to move only the first instance, not the second one. How do I make my code to apply only to the first instance...
  14. oldnoob

    [SOLVED] Help with destroying an instance

    Hello there, Platformer question: I'm having trouble destroying an instance of an object my player is sanding on.The sprite connected to the obj_blockcollapse has 9 frames of animation and the object's create event sets both the image_index and image_speed to 0. The code in my player's step...
  15. P

    GMS 2 [SOLVED] One of my objects suddenly is unable to find the instance of another

    I have a "player" object and a platform it can stand on, and when it does, said platform falls downwards. In order to make the player stick to the falling ground as it falls, it has to instantly go at the same speed (be moved down the same amount of pixels each frame) as the platform. This is...
  16. H

    GML select an instance with its ID ?

    Hello Imagine that I have a variable containing an ID (integer) like : myid = other.id; But that's not really the question, I would like to know if there was any way to do something like this: with(myid) { ... } instead of with(other) { ... } Is it possible ? Is it possible to use the...
  17. jf_knight

    Legacy GM Simultaneous instance create

    I'm trying to implement a hit-scan shotgun. Every instance... instance_create(x+lengthdir_x(length,direction ),y+lengthdir_y(length,direction ),projectile) ...creates one "hit-scan line". I would like to use 5 or 6 at once, however an instance is created one after another and not at the same...
  18. XirmiX

    GML [SOLVED] Assign code to just-created instance BEFORE it runs its create event?

    I've found trouble doing this. It essentially boils down to having the create event code from the object be placed inside the object/script that creates it. The "with" variable does not help at all, wish it did, seems redundant otherwise. What happens is: Object creates an instance of another...
  19. T

    GMS 2 Instance Order In Layers is Glitched

    Since updating to runtime v2.2.1.287 I've noticed somthing strange. (it also happens in 291..) when deactivating/activating instances, they go back to the layer they were depending on their Creation Order! instead of their order inside the layer, and I've found no way to control it. example...
  20. M

    Check the value of a variable in a specific instance

    Hi there! After reading a lot of thread about similar problem I still can't figure it out how can I check a value of a specific instance and do an action. That's my code. It works but it's always goes to Option room and never in Atrio room. if mouse_check_button_pressed(mb_left) {...
Top