object

  1. 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"...
  2. 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...
  3. 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...
  4. D

    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...
  5. Z

    Layer Depth Assignment From An Object To Another [SOLVED]

    Hi everyone ! I have two objects : - The first one is the one the player controls. Named "PLAYER". - The second one is an object (rather a group of objects) distributed on several layers. Each layer has its own depth and each object from that group take the depth of the layer on which it has...
  6. M

    Legacy GM Created exists instance is replaced by other created instance

    Hello I need help with my code because I tried everything what can I do with my skills and I don't know how to fix it... here is problem: https://imgur.com/a/P4iHi6c Just when particles (object/instance) exist and also created new one, exist particles is replaced by new one. I tried any...
  7. S

    Lighting on objects

    How to do a realistic lighting on objects? If a light directional light falls on an object, then the side of the object facing the light should be brighter than the other side.
  8. PlayerOne

    GMS 2 [SOLVED] Drawing an object on screen

    So far this code will position an object on screen (not in the gui) and can be interacted with. This all works as intended. However every-time the player moves the object in question will shift slightly while still staying in place. I checked other forum posts for a solution but the results...
  9. N

    (SOLVED) Error when passing an object as a script argument

    Greetings, first time posting here. I'm trying to make a standard turn-based battle system, but I keep having trouble when starting the battle from a script. I'm trying to pass enemy objects as arguments, so the script assigns them to the enemy array in the battle_logic object. Here's my code...
  10. L

    Legacy GM Sentry Enemy Coding Help

    I'm working on a stealth game and revising some mechanics. I have a sentry enemy that used to have a constant, swiveling line of sight. I'm trying to change it at the moment so it instead lies "asleep" for a few seconds, "blinks awake" for a few seconds during which it can detect the player...
  11. zendraw

    Legacy GM Q:Unknown object.unknown variable

    why does this code if (place_meeting(x, y, par_alien)) { with (par_alien) { if (place_meeting(x, y, other)) { var abz=abs(z-other.z); if (abz<other.targ_range) { other.targ_range=abz; other.target=id...
  12. P

    Drag And Drop Child Ojects Changing Because of Parent

    Hey, I'm a beginner to GameMaker and I'm having some difficulty with two of my objects changing their sprite because of their parent object. I have the child objects (the boots) change their sprites depending on the direction the character moves. I have also set the parent object's (ship body)...
  13. S

    GMS 2 Few issue. I record video on youtube :-)

    Ok here is a video and please dont punish me for accent and all aboat my english i know its terrible. Here is first code for sticking object : Here is code from weapon: Here is code for moving and shifting: Thank you for reading and answers.
  14. S

    Movement control

    HI everyone. I am not so cool at gamemaker, so need your help. In my game i have objects that move with other ones, for example spaceship that is flying and turret that is on it and can rotate and shoot. Same thing with many other objects, but when one object move another object move not...
  15. P

    Windows "physics_apply_force" doesn't work for 0 density object

    I have an object with 3 fixtures (don't know if that counts). It has physics enabled and 0 density because I need it to stay still on screen. I'm trying to use "physics_apply_force(x, y, 0, -15)" on "Left pressed" on it. Doesn't budge. Is this the way things should work or am I doing something...
  16. B

    Transferring the object

    Hello everybody I am quite new to game maker studio so I wanna ask you something. How do I transfer my object (player) from one room to another along with some other objects too. Any help please. Thank you
  17. N

    Legacy GM With but not self.

    Hi, this doesn't work: with (obj_projectile(not self)) instance_destroy(); Can someone please give advise?? Thank you!
  18. G

    [SOLVED]Making it so when a player touches an object it boost or decreases another objects speed.

    So as the title states I need help getting it so when a player collides with another object it decreases and increases another objects speed. So far I was able to get it to do both increase and decrease an objects speed, but it works weirdly. So I want it so after a few seconds the boost in the...
  19. S

    Checking for objects! Help!

    Hello! So I have a problem with my enemies spawning on items and each other, and not being able to move. Can someone show me the code to check if there is not an object in the way before spawning the enemy? I know it’s simple, but I’m self taught. Thanks for your time!
  20. G

    GMS 2 [SOLVED] Problem with moving an object a certain way.

    Hi, so I'm in the progress of trying to master the Gamer Maker 2 programming language. Recently I stumbled across a little problem. What I'm trying to accomplish, is moving an item object to the center of another object, whereafter a series of events will trigger when the two objects are on top...
Top