Hierarchies
Scene graph is a fancy name for a tree structure or a hierarchy.
Scene graph is a fancy name for a tree structure or a hierarchy.
In it a root parent object can have children.
In it a root parent object can have children.
Those children can then have children of their own and so on like a Family Tree.
Those children can then have children of their own and so on like a Family Tree.
We will create a hierarchy of objects attached to the Player Box so that they move around with it.
We will create a hierarchy of objects attached to the Player Box so that they move around with it.
Select your PlayerAnimations Sprite
Select your PlayerAnimations Sprite
Hold SHIFT and Select the PlayerCollision Sprite
Hold SHIFT and Select the PlayerCollision Sprite
RIGHT-CLICK on the PlayerCollision Sprite
RIGHT-CLICK on the PlayerCollision Sprite
Choose HIERARCHY
Choose HIERARCHY
Click on ADD SELECTION TO THIS INSTANCE
Click on ADD SELECTION TO THIS INSTANCE
You will now see a green arrow
You will now see a green arrow
Originating FROM the PARENT to the CHILD
Originating FROM the PARENT to the CHILD
Place the PlayerAnimations on top of the Player Box - position. (64,704)
Place the PlayerAnimations on top of the Player Box - position. (64,704)
Test the game to see that they move together.
Test the game to see that they move together.
Our next step is to add a dust cloud particle effect to the player as they run in the cave.
Our next step is to add a dust cloud particle effect to the player as they run in the cave.