GameMaker: Studio

GameMaker: Studio

View Stats:
One object won't turn invisible with parent
I've added the items in my game to a "depth object", as "children". I've given that parent object the code "visible = false" for the creation event.

Testing the game almost every object is invisible now, except for one. I had thought I might have simply forgotten to put it under the depth object as a child, but it seems to indeed be child of the depth object.

What (else) might be causing this one object to show up?
Last edited by An Easy Target; Mar 30, 2021 @ 1:33pm
< >
Showing 1-1 of 1 comments
The Winter Bud Mar 30, 2021 @ 3:27pm 
if the offending object has a create event itself it wont run the parents create event unless you inherit it by either using the drag-n-drop button on the conrol tab called 'call event' or by using the line
event_inherited()[docs.yoyogames.com]
This function will call the current event of the parent object of the instance. Normally, when an instance has a parent object, it automatically inherits all the same events as the parent, but if (for example) your parent object has a create event and you add one to your child object, all instances of the child object will run the new create event that you have added and not that which is in the parent object. Should you need to use both the parent object event and the child object event of the same type, you should use this function as it will run the parent object event before continuing with the rest of the code or actions that the child event contains
Last edited by The Winter Bud; Mar 30, 2021 @ 3:33pm
< >
Showing 1-1 of 1 comments
Per page: 1530 50