instance

  1. 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...
  2. 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...
  3. X

    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...
  4. T

    GameMaker 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...
  5. 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) {...
  6. K

    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...
  7. 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...
  8. G

    GameMaker 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 =...
  9. 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 =...
  10. FlatulenzaFiamm

    GML Visual 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
  11. 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...
  12. O

    Delete certain instances of an object?

    I was wondering how I can delete certain instances of an object. I created a wall object, and I wanted it to be deleted whenever my character opens up the menu, (scr_menu), and selects delete (or case 0 from that script). I was wondering if it was possible to do this after placing the tiles in...
  13. J

    Issues with instances and if statements

    So the player object is supposed to cross over a floor object, with the floor object switching to a red floor object. If the player object is not touching the red floor object anymore, the red floor object dissapears and turns into a wall object, meaning they can't go back.the Here's the code...
  14. jf_knight

    Legacy GM [solved]"Unable to find any instance for object index..."

    I received the following error I'm working on an "aim/view" system that extends the view of the camera in relation to where the player is facing and if the player presses the aim key (aim_key = gamepad_button_check(0, gp_shoulderlb)) (if the player is facing left, the camera moves vertically...
  15. S

    Instance_change animations problem

    hello. So i have my guy standing with his standing animation. then when i press 'T' i want him to attack using the following: instance_change(obj_player_hit, false); But when the instance changes, the animation doesn't start from the first frame. It starts from the frame of the previous...
  16. Cloaked Games

    GameMaker [SOLVED] Manually Setting Layer for Instance

    Hi, there's a GMS2 bug which I am dealing with here. https://bugs.yoyogames.com/view.php?id=27963. Here is the thread where this originated from. It's a year old so you can imagine I'm a bit peeved that it still hasn't been fixed either...
  17. W

    GML Visual How to get the X and Y coordinates of a specific instance?

    In my game it has several obj_enemy instances. There is another object called obj_vision that is supposed to follow the enemy around. There is one obj_vision per obj_enemy. I cannot do jump to obj_enemy.x/y per step because that would cause all the obj_visions to go to 1 obj_enemy. So I gave all...
  18. E

    Question - IDE [SOLVED] Asset Compiler Error - Instance Issue

    Hey! I already submited a bug report for this, but I haven't got a response in a while (I think?) so I'm trying my luck here. After updating to the last GMS2 version this message started appearing while compiling, which says: "Reference to object isn't stablished as an instance of an object"...
  19. M

    HTML5 Function layer_instance_get_instance() not defined on HTML5

    Hello, Seems that the function layer_instance_get_instance is not defined neither for the HTML5 export, Test and Debug. I've created a simple example with nothing except a call of this function and I get the same error. How come this function does not exist in HTML5? Should I file a bug...
  20. S

    GML NOT working more than 1 instance

    I have a program when an obj_pawn move (when key released) on one square towards wall and when obj_pawn is next to wall it will destroy and then when i released a key the obj_pawn respawns again and do the same thing again. So, I have an object of obj_pawn and it works great. But when i create...
Top