• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

parent

  1. M

    GameMaker Keyboard controls not (?) inheriting from parent to child

    Hey all, new to the forums here but I have been fiddling with GM for a while. I have a parent with string variables (up/down/left/right) in place of WASD keys, and the intent is that I will have multiple children using their own version of these variables to have two players on-screen at a...
  2. S

    SOLVED Bug with Inheritance? Searching everywhere, no answers, loosing my mind here.

    Ok, so i have been searching everywhere to figure out what is going on with this. I have an object = obj_entity_parent I have 2 children of obj_entity_parent called obj_player_parent and obj_enemy_parent. I have 2 children of obj_player_parent called obj_player_char_1 and obj_player_char_2. I...
  3. L

    SOLVED How Does .Parent Work?

    I'm struggling to find information on how using .parent works online or in the documentation. I'm wishing to use it to check if an instance has a certain parent object. For example: if instance100776.parent = obj_BasicEnemy { do some stuff } Doesn't seem to return the parent object in any...
  4. AndreLeier

    SOLVED Return the index of a child object

    Hi everyone, I'm making a game and I want to get the individual index of a object, but only if it's a child of the obj_enemy parent. So I came up with this code. // Check if the mouse button was pressed if (mouse_check_button_pressed(mb_left)) { // Get the ID of the object clicked on var...
  5. 2

    GML Get Lowest, 2nd Lowest, 3rd, ect. of id of Specific Object in Room

    I want to be able to display some test variables from objects that all share one parent object. Right now all instances display their values at once over each other. I need to get the lowest id of existing instances of that object, and if I press "H" on the keyboard repeatedly I need the 2nd...
  6. Shvrrs

    GML Visual Parenting objects when the child could be player or enemy controlled

    First post here. Would appreciate any help you can give me! I'm working on a game with RPG elements, where the unique characters (called heroes in the game) have attributes like: Name Battle-related stats (HP, attack, etc.) Quotes (lines that they'll repeat) Sprite (a specific sprite unique to...
  7. NikkoTC

    Asset - Scripts GML-Classes - GML script providing OOP features.

    What is it? GML-Classes is a script that provides some OOP functionality that allows you to define classes, their constructor and destructor, and call parent methods in overridden methods. Why does it exist? The main reason is convenience, in particular the convenience of calling parent...
  8. Masstertron

    instance_destroy() doesn't work on parent objects

    Hi everyone! (GMS 2.3) I've noticed that using instance_destroy() doesn't work for children objects. For example, when I use instance_destroy(obj_enemy), my expectation is that all enemies, including child-object enemies (eg: obj_enemy_bird, obj_enemy_fish) are destroyed. What happens is no...
  9. 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...
  10. theshaggyfreak

    Windows Events List (child inherit issue)

    I've come across something that I'm not sure if it's by design or if it's a bug. If I had an object as a child of another object that has a particular event, said event does not always show up in the child's event list dialog box right away. If I close the dialog box and reopen it, the event...
  11. William Garrison

    Variable not working?

    So simple enough. I am trying to make a parent asset that utilizes the in room variable for what object is being controlled and/or called. But the game doesn't seem to be recognizing it. So here is the setup... Inside the Step Event if (triggered = 1) { instance_create_layer(oHero.x+150...
  12. P

    SOLVED How to compare return of the parent_get function

    Hello everybody, probably the heading for this thread sounds strange but I Really have troubles when dealing with function object_get_parent and object_index variable, so what I want to achieve is simply make one object perform the action depending on what it collided with, so For Example, if...
  13. flyinian

    SOLVED Parent and first child have same index/id?

    I am having trouble updating data when switching what is being selected(think of items in a store and when you click different items, it gives different data for each item). This is determined by the object's index/id when clicked. I noticed that the parent and first child of said parent has the...
  14. Writerstix77

    changing cursor to different objects

    I am trying to create a Room Escape Game and am having trouble with the mouse. I want to be able to have the user click on an item in the room (wrench_obj), and have it stored in the inventory off to the side (as wrench_inv). I then want the player to later be able to click the inventory item...
  15. M

    child with multiple parents (grouping objects)

    Hi guys I just figured out, that a child object can have just one parent. I would like to group some objects for different collision checks and behaviours, but some objects has to be in multiple groups. How can i solve this? Example (Pseudo code)...
  16. L

    Hitboxes + Enemy Parent Issue

    Hello all, I've been experiencing some problems with the hitboxes and enemy parent. Once the player's character collides with the enemy, they become stuck but before I made changes to the player's sprite; everything was fine and working. I recently switched back to the original sprite to fix...
  17. F

    How to override parent create event

    So very simple issue thats more of a coding pet peve than anything. Basically the parent of an object has creation code that is semi long and nothing needs to be changed except for a few variables. So when the child has a create event with "event inherited" even when the code after sets the...
  18. S

    object w parent (child object) not being created

    hi all, im not new to gml but i havent touched it in about a year and im having trouble creating a child object. so i have a parent button object (o_par_button) with two child button objects (o_button_green and o_button_red). im trying to create the child button objects in-game via another...
  19. Antikore

    Legacy GM Parents are broken

    I'm having a lot of trouble and issues when trying to use parents with my objects in my game. Until now, they were working good, but I added a level editor to my game and when importing a level into the real game, I have multiple issues when things are changed. One of them is the most obvious to...
  20. mbeytekin

    Changing Spine Bone Parent

    I tried with skeleton_bone_state_set and skeleton_bone_data_set for changing a bone's parent to "root". But it doesn't work. in documentation; var bone_map = ds_map_create(); skeleton_bone_data_get("head", bone_map); ds_map_replace(bone_map, "parent", "body"); skeleton_bone_data_set("head"...
Top