GMS 2 Spawned Objects Not Keeping Up with Player. [Solved]

Discussion in 'Programming' started by Silver_Mantis, Oct 8, 2019.

  1. Silver_Mantis

    Silver_Mantis Member

    Joined:
    Feb 21, 2017
    Posts:
    452
    Hello there. Just a quick question,

    So when I create an object onto a new layer it seems to have a hard time following my obj_Player.
    It kind of drags behind the player, or floats rather.
    I had a build completely crash and now have to rebuild it sadly but in the previous build, (which I used the same code from), this issue didn't occur.

    Can someone explain why it does this?

    Code:
    if (instance_exists(obj_Player))
    {
        x = obj_Player.x;
        y = obj_Player.y;
    
    }
    Thanks!
     
    Last edited: Oct 8, 2019
  2. Silver_Mantis

    Silver_Mantis Member

    Joined:
    Feb 21, 2017
    Posts:
    452
    Welp I fixed my own issue.
    I had to place the Player object at the top of the group list and the spawned objects x & y coordinate were fixed!
     
    HayManMarc likes this.

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