1. L

    How do I set the instance motionless when I set a view in room?

    Hello everybody, I have a such for me complicated problem. I drew a rectangle slot in Draw Event in object56. That's okay, when I go down with my main character, it is still on its place, it is motionless. The code looks like this: draw_rectangle(view_xview[0]+5, view_yview[0]+32...
  2. Z

    Calling an instance

    I struggle with instances. I've written below what kind of feature I am trying to implement, but in short - I don't know how to call for variables of an instance and modify an instance by its properity outside it. Please, write me a short code that would call a value from a specific instance, so...
  3. graphicsdump

    [SOLVED] GMS 2.3.3, How to spawn enemy instances and control each instance separately

    Hi all! I currently have enemy objects (small rockets) that are spawned using a time interval, and when an enemy object's x position matches the player's x position, I have it working where the enemy object's direction changes from 0 to 90, flying towards the player. The problem is, every...
  4. NovemberTender

    SOLVED creating instance based on cardinal direction.

    i'm not sure if im doing it right but, it somehow works. I have 4 sprites for each direction( so i dont have to flip the sprite in code) and i tried to find the direction using collision mask, is there any other better way? i've tried my best looking up cardinal direction and collision masks...
  5. FullCup

    GML Collision with specific instances of an object

    I'd like to put an instance of an object into a "collidable group" in some cases. For example: If the player collides with a "water coin" INSIDE the water, he CAN collect it (just an example). My first thought was to change the parent just before the collision check and then return to the...
  6. W

    Windows [Help] Global persistent instance across rooms (not Object , but only particular instance of same object)

    Hi Guys, I tried to create persistent instance from certain object and store it in global variables, so that i can access it across rooms. I deactivated the instance each time i created it. So when i changed room, looks like i'm facing issue to find the instance. Here the snippet of the code...
  7. Misael644

    SOLVED Any function or code that works like "draw a line for the instance whose variable is x?

    Hello! So, basically I want to make a code that is like: "draw a line for the instance whose variable is x". I thought about using instance_find to do this, but it only works like "I will only draw a line if the instance id is x". I wanted to use such a function to make "line graphics", which...
  8. R

    Code only works on first enemy created

    Hi everyone, I've got a bit stuck on an issue. I have my music change when in a certain radius of an enemy. However it only seems to work on the first instance of the enemy that was created. Any idea why it only works on one enemy? Big thankyou in advance for any help. EDIT: Also worth pointing...
  9. Nathan

    GMS 2.3+ Is it possible to add different destroy triggers to instance of objects?

    I want to have a base object, and have lets say 20 instances of this object in a room. When the player touches the different instances, is it possible to make the individual instances trigger different events without having to make a duplicate object for every object instance that I want...
  10. giraffeman210

    GMS 2 Instance Create based on Viewpoints

    This seems simple and yet I can't find anything about it. Is there a way to create an instance based on coordinates of a viewpoint? Say I have a room a few screens wide yet no matter where I am I want to create an object in the middle of my viewpoint? Is this possible or can I only draw things...
  11. FoxyOfJungle

    SOLVED PATHS: Get hspeed and vspeed of an instance ??

    Hello, I'm trying to acquire the vertical and horizontal speed of an instance in which is using a path, but apparently there is no way to do it... I just did this: CREATE EVENT: my_path = -1; alarm[0] = 2; STEP EVENT: // hspeed and vspeed hsp = x - xprevious; vsp = y - yprevious; ALARM 0...
  12. A

    Collision with multiple instances of same object

    I’m looking into how physics works, and I’m trying to have multiple instances with the same objects collide with each other. I know different collision groups have collision against one another, but that’s per object and not per unique instance. What’s the best way to accomplish this?
  13. J

    Instance creation not working

    Hi there, long time user and lurker of GM. I'm currently having a problem with instance creation, none of the instance functions seem to draw to screen despite being in the draw method. Here is my simple test code, which does not draw: create_instance_depth(room_width, room_height, 10000...
  14. G

    Drag And Drop Creating an instance using a variable.

    When creating an instance, is it possible to use a variable containing the object name instead of the object name itself? Whenever I try doing this, it results in an error.
  15. zendraw

    change instance`s object index

    is it good practice to use this function? instance_change(); one of the things that worry me are the facts its not accesable after you run this function and if you try to acceess it it wuld return an error, which is what the manual says.
  16. konkrz

    GMS 2.3+ "sequence_instance_override_object" trouble - object disappears (possible bug?)

    I've just started fiddling around with sequences and they seem to have great potential but in my first try making the simplest thing I ran into a problem. As soon as I start the sequence, the original object instance becomes invisible (as it should) but it doesn't become visible again after the...
  17. K

    Drawing Sprites while game is paused

    Ok, basically. To pause the game i'm making I use the code: if(keyboard_check_pressed(ord("P"))){instance_create(0,0,Pause)} And then, in the create action on Pause instance_deactivate_all(true) But when I do this, every instance Just stops being drawn. How can I pause the game, and still...
  18. S

    GML How i can create and save a variable for every Instances of an objects in one room?

    Hello all. I were thinking about creating and saving (in hdd or etc) a variable for every instance of an object in one room. i have thought about using of id or instance_id but i couldn't make it working. So how i can create and save a variable for every Instances of an objects in one room? For...
  19. T

    GMS 2 Is there a way to get the unique instance identifier? (not ID)

    Hello, I have a decent, but important problem when trying to communicate with unique instances in my game. I could use the ID of course (stored in variable id), but this is not static and changes if I add any nex instances to the layer. There is however this instance identifier thing, for...
  20. Axl Trauts

    SOLVED Get center of every children of Parent_Enemy instance

    Hi, I have a top down shooter and I have this special gun that shoots sticky bombs from above. The should appear at the middle of every enemy instance using its parent par_Enemy. Each enemy has different origins due to their unique behaviors, so using something like this on the script that...