1. flyinian

    SOLVED Interact with a single instance

    I have instances that the player can set on fire. If these instances are close to one another, the player can interact with all of them at the same time. What can I do to prevent this from happening. Code(Step): if(distance_to_object(Obj_Player) < 30 && !_SetonFire){ _Close = true;} else{...
  2. giraffeman210

    GMS 2.3+ Created Instance that can change creator's variables?

    I am trying to make something where an instance is activated and it creates a different instance. and I need it so the created instance knows the creator. This way when you activate the newly created instance it changes a variable on the instance that created it. Any ideas? Thanks!
  3. S

    New instances negating code of previous instances

    Hey there, In my project, I have instances that are being created and moving from left to right every few seconds. The player's objective is to capture these objects before they exit the screen, but after a new instance is created, the previous instances no longer move towards the player when...
  4. 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...
  5. flyinian

    SOLVED I was getting these errors when I was renaming instances in a room. Could someone explain why the errors were created?

    Could someone explain this to me? I found a fix for this error, I just don't understand why it was coming up. I have enums called "Zone.Zone1", "Zone.Zone2" "Zone.Zone3",.... Could this be a cause? Hence the, " Script: Scr_GlobalVariables at line 67 : "Zone1" is a macro and cannot be used as...
  6. D

    SOLVED Help with "with statements" and instances

    Hello! I've been struggling a bit on understanding how to manipulate and instance objects on multiple instances of my enemies. Basically i'm trying to create a secondary collision mask that follows them locked to their x, y. if (!instance_exists(obj_M_Collider)) {...
  7. E

    GMS 2.3+ Same object, different messages

    Hello, in the game I'm creating, the player goes in a bedroom where a lot of papers are pinned on the wall, and everyone has a different message written on it. In order to do that, I only created 4 objects, for the 4 sprites (4 different types of papers pinned, to have some variation), but i...
  8. FoxyOfJungle

    SOLVED Click on the TOP depth instance of a layer??

    Hello! I want to click on the instance that is on top of the others, but make the loop only on a specific layer. The function I have works the way it should: The above function is an adaptation of this video. However, if I check objects from another layer, this happens: (The left...
  9. flyinian

    SOLVED How would I get a instance to pass its draw code to a parent and then have that parent send said draw code to all its children?

    I have 1 parent w/ multiple children. I then have one object(obj_DrawCode) that is passing its draw code to the parent. My problem that I am having is that only one child is receiving the draw code. I checked the debugger and it says only one sprite is being drawn. I am trying to draw a...
  10. W

    Destroying a specific instance

    Back for more help. I'm trying to destroy a specific instance, here's the info; There could be many instances of an object. I want to click on one of the objects to bring up a menu. If you click on a destroy button on that menu, you would destroy the instance of the object that was...
  11. E

    Question - Code Instance Create Layer and Possible ID passing issue.

    BACKSTORY: The issue I believe is with my ID, I’m working on an RTS style game, where my spawner lets say a space station spawns units every 3 seconds of a player object “spaceship”. The battlefield has units running around randomly and when they spot a player spaceship and they attack it. I...
  12. paulog

    SOLVED Instances acting differently

    Hello! I'm making a game in GM1.4 but I'm facing some issues. I really hope somene can help me out. In the game some objects have to jump to another position if the player clicks a button. I made two variables, "global.rot" and "global.oldrot". They both have the value of 1 when the room...
  13. P

    Legacy GM [SOLVED] GM Studio 1.4 - Instances Outside of Room Check

    I feel like I have looked everywhere in preferences, but I cannot find where I can disable this check. I *want* my objects outside of the room, and I don't want to accidentally remove them all. Anyone know how to stop this?
  14. Fluury

    Figuring out a point of collision between two bounding boxes

    Heya. Following idea: I'd like to create a particle effect at the point of collision between two bounding boxes. Say you've got yourself a sword attack and your classic enemy, and you want a spark to appear at the location the sword attack hit the enemy - How would you figure this out in a way...
  15. C

    Check small collision_lines for multiple instances

    Hello everyone, Only been using GMS for a little while and having an issue with multiple instances of an object using collision_line(); I have an object that detects if the player object is right below it or right on above it. Either way, when one of these collisions happens, another...
  16. Fluury

    Memory Usage and the amount of Instances.

    Heya! I have lately ran into an interesting "problem" which is making me pretty confused. The project I am working on has level generation, which is creating a lot of instances. Some levels are bigger than others, and thus are more prone to having more instances. One day I realized that the...
  17. flyinian

    SOLVED Pause all but one room?

    I am trying to implement a pause system into my game. The only time I want the game to pause is when the player is on the main menu room. I have numerous persistent objects that are initialized on game start. Could I use instance_deactivate_all(true) and pick and choose which instances don't...
  18. flyinian

    Suggestions on keeping instances in their current states.

    I am making a system that places the instances in a room once clicked either true or false. However, I ran into an issue where once I leave the room it resets the room back to its initial state. which means that the instances have been reset. I discovered that I can use the persistent room check...
  19. FrostyCat

    Asset - Scripts Extended Collision Functions

    Extended Collision Functions Companion scripts for built-in collision functions Overview Extended Collision Functions are enhanced versions of built-in collision functions. You can now easily check for collisions with multiple unrelated objects/instances at a time, and optionally pass in a...
  20. Krenzathal77

    Using "with" to store ID of an object's creator in variable (not working)

    Hi folks, I'm having a problem with storing instance IDs. I have multiple instances of an enemy object that can attack the player with punches/kicks etc. These enemies create hit objects which collide with the player, so obviously I want the hit objects to know which instance is creating them...