Parent behavior

In my game I’m wanting to add different characters the player can select and I was thinking of keeping all my code in character 1 then making character 2 a child of the first character and adding on whatever extra things I wanted. But when I tried it it seems like only some of the code in my character 1 is working on character 2. Character 2 has the same controls but isn’t destroyed by the same blocks that character 1 was destroyed by.

Are there some limitations to making an object a parent of another object? I was under the impression the child inherited everything from the parent but it seems like I’m wrong…

Link? We need one so we can see what youre talking about in greater detail

On the main screen select the player you want then play the game. The yellow player is the parent of the red player and works correctly. if the red player is selected the mouse click events work but not all of the collisions work. The red player can collide with the small blocks and destroy them but when the red player collides with the spikes on the very bottom of the screen it is supposed to end the game but nothing happens.

The red player has no code, the only thing it has is the yellow player selected as the parent.

Hey @zgaulke - I’m guessing you may have made some changes, since it looks like both the red and yellow objects have code in them. Collisions should work the way you expected. If you have collisions set to target object “Parent”, then they should trigger against object “Child” as well. This works generally, so I’m not sure why it wasn’t working for Droppy Block.

If you want to set it up so that I can see the issue, I’ll be able to fix it for you. Of course, If you are working around the problem some other way, that’s fine too :slight_smile:

@grazer I wasn’t clear enough, the menu screen objects had code in them and were just used to select your character, once you play the game either the parent (yellow player) would be spawned or the child (red player with no code) would be spawned. But instead of trying to figure out where I went wrong I’m just going to copy and paste code I think. Thanks for checking though!