Antikore
Member
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 say that parents are broken. I have two objects "obj_stoptile" and "obj_object". stoptile hasn't any code, but a code is run from another place to check for this object to do certain actions. Before this bug, it didn't inherit from any parent, I added obj_object as a parent that actually by itself it's only a classificatory object and also doesn't do anything but for whatever reason, the detection of the obj_stoptile when is parented with obj_object is bugged and doesn't work properly.
Code for checking the player if there is an stoptile after it:
If obj_stoptile inherits from obj_object, the player stops when it has passed most of it. When it doesn't inherit from anything, it stops exactly where the stoptile is, just how I want.
This also seems to happen with other objects.
When it doesn't inherit from anything:
When it inherits from obj_object (or any other, as I've tested):
Things I've tried:
Thank you for reading
Code for checking the player if there is an stoptile after it:
Code:
var xx, yy;
xx = sign(hsp) * 16;
yy = sign(vsp) * 16;
if (place_meeting(x+hsp,y+vsp,obj_stoptile) && (atStoptile == noone || atStoptile != instance_place(x+hsp,y+vsp,obj_stoptile)) && !toStoptile)
{
toStoptile = true;
atStoptile = instance_place(x+hsp,y+vsp,obj_stoptile);
slave_collider = instance_create(atStoptile.x+xx, atStoptile.y+yy, obj_slave_collider);
}
This also seems to happen with other objects.
When it doesn't inherit from anything:
When it inherits from obj_object (or any other, as I've tested):
Things I've tried:
- A lot of things, I don't remember, but mainly removing the parent and placing it. Changing where the check for stoptiles executes etc.
- Windows 10
- GameMaker: Studio v1.4.1804
- Standard Edition
Thank you for reading