1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GMS 2 How can I child one instance to another?

Discussion in 'Programming' started by Creative Sam, Jun 3, 2019.

  1. Creative Sam

    Creative Sam Member

    Joined:
    Jun 3, 2019
    Posts:
    1
    I am a newb at GameMaker. I have a 2D map which you can move around. I want to add pins to the map, such that when the map moves, the pins stay in the same position relative to the map. By default, the map will move, while the pins remain stationary.

    I have tried creating a sub-layer of instances on my map instance layer, but the depth of the sub-layer is always greater than the parent layer. I have tried overriding the depth, but it gives me a warning suggesting unpredictable results.

    [​IMG]

    [​IMG]

    I have searched the internet, but all I could find was overkill code which I am hoping is not necessary. (And none of those suggestions directly addressed my question.)

    How can I make it so that my pins move around with the map? I would like to avoid using code for something so simple.
     
  2. samspade

    samspade Member

    Joined:
    Feb 26, 2017
    Posts:
    2,124
    I don't really understand either your title or your question or enough about what you are trying to do. Your title says "How can I child one instance to another" but your post talks about layers in the room editor. These are not the same thing. Additionally, it seems what you want to do if have pins on a map move when the map moves. This is not related to inheritance, in either objects or layers, and not related or solvable by using layers at all.

    It might be helpful to explain a little more about what you want.

    For the moment, I'll assume your question is "How can I make is so that my pins move around with the map". To answer this question we would need to know what your map is - e.g. is it a surface, a view, an entire room, etc. - what your pins are - objects, sprites on an asset layer, etc. - and what your code to move the map around is.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice