1. 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...
  2. 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...
  3. 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 =...
  4. 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 =...
  5. 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
  6. 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...
  7. 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...
  8. Jmarlin3

    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...
  9. 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...
  10. 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...
  11. Cloaked Games

    GMS 2 [SOLVED] Manually Setting Layer for Instance

    Hi, there's a GMS2 bug which I am dealing with here. 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...
  12. W

    Drag And Drop 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...
  13. 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"...
  14. MarceloP

    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...
  15. 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...
  16. inertias

    Help me understand this code that works

    So someone asked a question on reddit about instances following the individual object that creates them. If you look at the posted solution, it works perfectly but I don't understand why. Here's what they wrote: Haven't been programming for long so I don't understand the "inst.creator"...
  17. D

    Question - Code Is it possible to remove an Event during run time?

    Hello! I would like to remove the Step Event for some objects during run time (i.e, while playing the game) via code, is it possible? For example, let's say I have an object with Step Event defined in IDE. Then I run the game, start playing, an instance of that object is created, and later I...
  18. S

    GMS 2 NOT creating instances

    I have a problem with creating intances of an object. I need to move instance to the wall (after key released) then this instance should destroy. After destroing when i realesed a key (again) it shoul be placed into its first position and then repeat this action again. The problem is in not...
  19. S

    GMS 2 If Instance Clicked

    I have created a bunch of instances, I want to know how I would know if I clicked it because position_meeting() would activate all of them. It's a pretty simple problem but I haven't been able to find any answer anywhere.
  20. S

    Legacy GM [SOLVED] ds_grid Position Detection Help

    Hey! This is my first post on the forum so I'll try to be as clear as possible! I'm creating a digital version of the board game "battleship" for a coding class at my high school; however, I've run into some issues trying to get my grid to detect when an object is within a specific square. I...