instance

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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) {...
  15. Krenzathal77

    Windows Find ID of creating instance by created instance

    What's the best way for an instance/object to reference the instance that created it and then store that as a variable, but without doing it via checking for a collision or which one is nearest? I have an enemy instance which creates an instance of a hit object and I want it to follow the enemy...
  16. S

    Instance's Variables gets reset without a reason

    Hello everyone! I have checked all the instances related to this particular one but I couldn't find anything. It works fine (it's has important configuration variables like "Which character you picked" or "Which event you're playing", etc..) but when it goes to a special room, all it's variables...
  17. G

    GMS 2 Getting the names of the objects of all instances in a layer?

    I'm trying to iterate through layers and then all the elements in each layer and print out the names. I figured out how to do this for sprites but not for instances The short version is I call object_get_name but I'm guessing I need to do something else. var __inst =...
  18. MartinK12

    GML [SOLVED] How can I use object name in switch statement?

    I've created this simple code and depending what kind of object is selected I want to perform different actions on it, but looks like I always get default case. I don’t know where I messed up? Thank You for pointing my mistake :) if mouse_check_button_pressed(mb_left) { instance =...
  19. FlatulenzaFiamm

    Drag And Drop Create Instance

    Hi everyone! Id like to create an object via the Create_Instance, but only one. Because using the Step Event, the object created is more than one. There is a way I could create just one? Thanks again! :D
  20. G

    Legacy GM Instance variable logic problem

    Ok is very simple, I have an object with this in create event: acc_y = -8; and this in the step event: if (acc_y < 12) { acc_y +0,25} y = y + acc_y; Now i thought that the istances of the object didn't share the internal variables. When I spawn one moster his speed will be like +5, but if i...
Top