object

  1. Enes

    Drag And Drop How can I make an object jumping to player to a certain position?

    Right at the beginning of the game, there is an object that must jump to the player. However, it does this, but to the bottom of the player. What I want is, to jump to its head and not bottom. I already have changed the origin of both the player and the object but still not working. PLEASE HELP!!
  2. E

    Object behavior is all the same.

    This is my object spawner, which I'm currently testing with to help me understand controlling objects better. if alarm[0]==-1 { var inst_1 inst_1 = instance_create_layer(irandom_range(200,1910), 200, layer, obj_Enemy_1); inst_1.speed = choose(1,9); inst_1.image_angle =...
  3. W

    GMS 2 Script that returns a value returned from an object

    Hi GM community :) Here's a thing I need a bit of help with, and if I can pull this off I'll most likely never have to ask something here again (i know you're all tired of me at this point) Anyway I need a script that returns a value from an object. For example, let's say I wanted to ask the...
  4. 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
  5. FactorX12

    Object persistence - Resets coordinates upon setting persistent again

    Hi, So I have a game I'm making, and there are parts that set the persistence of objects to false, but when I turn it back to true, the x and y of the object reset. Let's say there's an object, it's starting point upon entering the room is (10, 10) and I move it in-game to (30, 30). Then, I set...
  6. T

    Help with ds lists and objects

    Hey All, this is my first post in the community. I hope it's clear for everyone to understand. So, I'm trying to place an Id for every enemy that my project has in the room at the start, I do it with the first paragraph of code that I'm showing here. // The variable auxId is created at the...
  7. E

    Legacy GM How to activate one object in room from many others?

    Little backstory: I have an idea to make enemy spawner - box, which gonna identify where to place the 'enemy' on the floor. It is an object that I can see in room editor, so I can stretch it and thus its code will allow to register all the floor it touches and make a random desicion, where to...
  8. Edwin

    GML How to find out all values in the array as one function?

    How to find out all values in the array as one function? For example: I made an array that will keep objects that can collide player. solidObject[0] = oWall; solidObject[1] = oBox; I want to make collision with all these objects in "solidObject" array but not separately. if...
  9. P

    GMS 2 Mouse-drag object goes through wall

    I have an object (uses physics) that I drag around with the mouse. Create event code looks like this: depth = -1000; grab = false; xx = 0; yy = 0; Step event code looks like this: if(grab==true) { xo=phy_position_x+xx; yo=phy_position_y+yy; phy_speed_x = mouse_x-xo; phy_speed_y...
  10. N

    Legacy GM Depth [solved]

    How can I set the depth of one instance? Because my semi-solid-platform (one way platform) appears in front of the other semi solid platforms. See PNG: But I want it as in the room editor: That the 2 bottom platforms are in front of the top one. I knew about the object_set_depth function...
  11. XirmiX

    GML Is it better for run-time to have multiple objects or a single object with multiple states?

    Lets say you want to have different types of projectiles for different weapons. Would it be wiser for better fps to have an object for each projectile type or have the projectile be a single object that has different types?
  12. jujubs

    GML Best way to ping-pong object (SOLVED)

    Hey everyone. I'm currently working on an enemy for my game which moves down the screen whilst swaying left and right. I achieved this by making it spawn two other objects that sit beside it and send it flying to the other. This works, but makes things needlessly complicated, I guess. I can't...
  13. H

    How to attach and object to another object?

    So an object is moving from for example 1920 to 0, and an another object stay's in collision. I want the other object always being attached to the first object, how can i do it? Thank you guys!
  14. M

    Windows Hi, I'm new. How to place player on top of an object?

    I have two layers. One for the player and one for the floor. When I try to place the player object on top of a grass object it is not aligned with the grass object.
  15. shostifrosty

    Legacy GM Object movement with paths

    Hello everyone! I've been struggling for several days with the objects movement through paths, and it would be awesome if someone could help me out a little with an issue I have. What I want to do is to have pedestrians moving around in paths I specifically designed for them. So far, I could...
  16. EZTALES

    Legacy GM ISSUE WITH DESTROYING OBJECT IN NEXT ROOM.

    hey yall. just having a small issue with destroying an object in the next room, im using a level system so when you reach a certain level, some things are deleted. heres the code. and yes the room uses physics. /// room end with (obj_player_stats) { if level = 2 { audio_stop_sound(sad_snowfall)...
  17. S

    GMS 2 Detecting all objects within a specific range

    I have a combat system that changes the behavior of enemy AI based on what other enemy AI are surrounding them. I need some sort of way to detect all of the objects near each enemy. I considered storing every enemy object's x and y coordinates in a list, and then creating a script to determine...
  18. 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"...
  19. Krenzathal77

    Legacy GM "with" command destroying wrong object

    Bit of an odd problem here. I have it so that when my player land on top of an enemy the enemy gets destroyed - sort of similar to how the Mario games work. The issue is that the "with" command is completely destroying the wrong instances, in fact it's destroying every instance of a type of...
  20. I

    Need help keeping cursor inside object.

    Hello! How can I keep cursor inside an object? For example, I have a volume slider and I want to keep cursor inside it until mb_left is released. I'm also going to hide the cursor and change a sprite of the slider. But first i want to figure out how to keep the cursor inside the slider when...
Top