depth

  1. EZTALES

    Legacy GM how to check depth from other object

    hey guys, having a error trying to check the depth from another object, says for an error "unexpected epression" code is below. anyone know why? thanks -EZ if place_meeting (x,y, obj_oilman_2) && with obj_oilman_2 depth = -101; { image_speed = 0.1; }
  2. E.M.I

    GMS 2 How to change the value of all objects inside an array

    Hey GameMaker community! So I'm trying to make a basic script that assures that shadows will always appear in front of the player but always appear behind the object they're the shadow of. For this I'm making code that, when the shadow collides with the player, changes the depth value of the...
  3. E.M.I

    GMS 2 "Trying to draw non-existing sprite" error while using variable

    Hey GameMaker Community! I've been working on a top-down game and have run into an issue with the depth system. I have two scripts that seem to be causing this error: scr_create_draworder, which creates the draw_order and draworder_size variables I'm using to store the grid size, as well as the...
  4. 2

    GMS 2 Studio 2: Finding Top Most Drawn of All Instances at Mouse Cursor on Click

    I need to make something that will return the top most instance where the mouse cursor is currently clicking. This is probably different in Studio 2, so how would I adapt the code below? It doesn't matter if the draw order is always the same, just that I can find from multiple instances at the...
  5. Didjynn

    particles over my draw event

    Hello everyone, I have an object drawing some sprites and emetting some particles. The particles options are set in the create event. The first game, particles are under all my sprites, which is what I want. But if I make another game/match, the particles are over it. In the create event I...
  6. K

    Windows check if player is below object?

    So I'm making a top-down RPG and I'm trying to make a tree object. Is there a way to detect whether the player is above or below this object, and change the depth based on this?
  7. F

    GMS 2 [SOVLED] Sprite Depth: Stretching to Layers or to Objects

    I need to draw a sprite at a specific depth in order to fit between layers, but I also need it stretched to double its current size. Option 1: Create a second sprite which is double its size, move it to an object, and draw it at depth. There are many sprites and this seems horribly tedious...
  8. V

    Isometric help (collision and depth)

    I've been struggling to determine the best way to have collisions and depth for an isometric game my team is making. I've been able to get some objects working properly, like a bus, but I had to split the bus into two parts, so I could also use a diamond collision mask. However, this game...
  9. MartinK12

    Question - Code Clicking top object – default behavior in GMS2 with manual depth?

    When u want to click top object and did not set depth of those objects the top object will not be clicked but actually the clicked object will be the first one placed in the room. But when you set depth each of those objects manually the object with the lowest depth will always be clicked. I...
  10. A. DeVivo

    Keeping Character at Correct Depth While Changing Rooms

    Howdy, Probably has a simple solution but I can't seem to find it- I generally put my character in a layer below foreground objects to allow for a feeling of depth, but now that I have several rooms that doesn't work after the player has changed rooms because a) if there is already a player...
  11. P

    GML Instance Create and Depth

    So when my character gets hurt, he is instance layer create switched with a hurt version of himself, but the instance is a lower depth than the floor model so you can't see him... Does anyone know a fix?
  12. S

    tree shadows under player

    hello. So. i'm using depth = -y to make the effect of going behind trees. My tree is: draw_spire(shadow) draw_self() so the shadow is under the tree. But when my hero goes behind the tree (depth = -y goes into effect), the tree shadow shows on top of the hero. when the hero is in front of the...
  13. bsabiston

    GMS 2 GMS1.4 -> GMS2 broken button behavior

    I imported my GMS 1.4 game to GMS 2 and boy it has not been smooth. One new issue I hit today: I have a button, a persistent object at depth 0. When the player presses it, I change the depth to -100 to bring it above some other stuff. Later, when they press it again, I put the depth back to...
  14. M

    Question - Code Dynamic depth bug

    I have found some weird behavior in GameMaker during the making of my current game and need some advise on how to fix this. I was able to reproduce it for a very simple case: Consider a 2D topdown game where a player object can move through the room. Also, there are some tree objects. Because I...
  15. 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...
  16. Toxic Tom

    Particle depth not changing

    I've created a particle system and emitted some particles (I've tried this by directly creating the particles and by using an emitter). globalvar particleSystem, bloodParticle, bloodEmitter; particleSystem=part_system_create(); part_system_depth(particleSystem, -1)...
  17. Coded Games

    Persistent rooms change object depth

    So one thing I just noticed is that if I switch away from a persistent room and then switch back to it the depth of some objects get changed. You can see this happening in this video: https://gyazo.com/d92e7fe0d38b8de2fd73c0b36e664508 Do you guys think this is a bug or should I just accept that...
  18. Z

    Depth Problem With Z Axis [SOLVED]

    Hi everyone ! I'm still struggling with my depth system for my top-down game in "fake" 3D. So, here's the situation : I set a z axis for "height" and created several collisions objects for my different levels. (My levels are based on a 32 pix height per "z unity") My depth system's like depth =...
  19. Z

    Several Depth For One Single Object [SOLVED]

    Hi everyone ! Oooook, that one is VERY tricky and I have no idea how to do that but I'm going to try my luck if someone has a solution ! In my game, I have two type of tiles for my graphics. Some ones are flat : The floor, aaaand anything else which is flat and set on the floor. Other ones have...
  20. J

    Maybe culling, maybe mask, maybe depth, maybe draw_...

    ..
Top