instance

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

    GMS 2 [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...
  4. 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...
  5. 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"...
  6. 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...
  7. s0ngbirdd

    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...
  8. 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"...
  9. Dani

    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...
  10. s0ngbirdd

    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...
  11. 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.
  12. 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...
  13. MarceloP

     Set object's draw order on "instance_create_layer"

    Hello guys! I'm working on a prototype and I've reached a moment where I'd like to create some objects on a Instance Layer. I called "instance_create_layer" and got what I wanted. But since I have more than one thing that will be "dynamically instantiated" I ran into a problem. When calling...
  14. I

    Legacy GM [SOLVED] Random enemy movement in turn-based game

    Hey guys, so I have a state machine of sorts. When the player character moves from one 48 pixel cell to another, global var EnemyTurn turns from 0 to 1 and makes the enemy randomly move a cell with this script: ob_enemy.dirr = choose(0, 48, -48) ob_enemy.dirr2 = choose(0, 48, -48) with...
  15. S

    GMS 2 Change Variables Of Specific Instances

    I want to edit each instances variables depending on factors. I would also like a way to identify them so I can delete specific instances. Anyone know how to do this?
  16. T

    Game pause with sliders

    Hello everyone! I made pause system, everything works well. I have sliders (for game options) as individual objects and when I create them with instance_create I don't see any sliders. Without pause sliders created well. Is there way to create active object when game is paused (I use...
  17. L

    GML Instance room editor id aka name

    Hey, is there any way how to get that instance name from the room editor? "inst_something" by default. I'm trying to edit some things in game - for visual aid, save them to a file and load back once game is restarted. Now I can't store instance's id as this may vary between game runs so the...
  18. FlamingYeti

    GML Accessing instance stored in array returns invalid object (-4)

    Hello, In my game, I initialise 9 markers using instance_create(), and store them in an array. Later, this array is accessed by another object in order to retrieve a random object from the array, but the game crashes, and returns the following error: Pop :: Execution Error - Variable...
  19. DarklinkFighter

    [SOLVED] Changing depth and using instance_deactivate_layer?

    Hi, I encountered an issue with my game after I tried to change the way my pausing works... Previously I created a screenshot sprite and deactivated all Instances but reactivated some controller objects... Now I tried to implement an Inventory and for that I refactored it to...
  20. K

    GMS 2 Discrepancy of instance_number and actual count caused by instance_change?

    In my game i have a certain hierarchy built for more objects. "obj_interact" is my main parent and has the children "obj_tower" and "obj_rock". "obj_tower" also has a few children During the game your create instances of "obj_tower" and then choose one to keep. Here it can happen that an...
Top