• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

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

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:
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!
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!
 
Top