• 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!

GameMaker Spawned Objects Not Keeping Up with Player. [Solved]

S

Silver_Mantis

Guest
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 by a moderator:
S

Silver_Mantis

Guest
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