# What is the "Parent..." option for a sprite?

I do some work in the Unity game engine. In Unity, when you select an object as parent, it means that the location and rotation are now local coordinates to that parent as the center of their universe. If you move the parent, the child moves with it, because it stays at that coordinate relative to the parent. If you rotate the parent, the child rotates around it.

I can't seem to figure out any effect when I parent one sprite to another.

ok, so when a sprite is the parent of another sprite, the child can become temporary, so it becomes a clone of the parent, but the child can only become temporary if this script is ran (in the sprite or in a tell block)

To make it like unity parenting, you can attach a sprite to another sprite making the sprites attached, like, when the anchor (the sprite the other sprite is attached to, ok, sprite1 is the anchor and sprite2 is the other sprite), sprite1 moves, sprite2 moves with sprite1. Same with rotating.

Sorry if this is not a very good explanation, and kind of incomplete.

The inherit block in the Variables palette can be used to make a clone share a property with its parent.
________^ this was not a cell phone spell check error; I did not use phone; it was a typo

Whoa.

@jens: Note how this example shows that the SET MY... notation makes the code unreadable except by experts. The submenu items should be my►temporary? or something.

@snapenilk: You meant inherit not inherent. Cell phone spell check error? :~) Also, I don't think that answers the question.

@ego-lay_atman-bay: Clones made by the program (a new clone of, etc.) are temporary at birth. It becomes permanent if you set its temporary? flag to false. The nomenclature in the my block is confusing, I think. my parent tells you your parent whether you're a permanent or a temporary clone. My children lists both permanent and temporary clones; my clones lists only temporary clones. Jens made up those names back when he was arguing that temporary clones and permanent clones are two entirely different kinds of animal with nothing in common. Now that he's seen the light on that subject, we should de-confuse the issue by eliminating my clones altogether and changing my other clones to my siblings, and not include the parent in the list, but include both temporary and permanent siblings. People can then use my temporary? to keep track of which are which. (But mostly that won't be necessary because I think it'll be rare for a sprite to have both kinds of clones, so sprites will know what kind their children and their siblings are.)

@brendandilloughery: This is the heart of the matter. The relation you're looking for is not parent/child but anchor/part. To set up a nesting (the general name for that relation), you grab the thumbnail of the sprite that should become a part from the sprite corral (below the stage), and drag it onto the actual sprite on stage that should become its anchor. The anchor sprite will glow when you've done it right, then you let go and it's set up. This can also be done programmatically; the would-be part does set my►anchor to the other sprite. The part will move with the anchor, and will revolve around the anchor when the anchor turns. Whether the part also rotates so as to keep a constant orientation relative to the anchor is settable; my dangling? is true if the part does not rotate when the anchor rotates.

thanks

I thought I was replying to something else that I think I read in this thread, but I can't find it. Well, think of my post as additional information. If you want a sprite to follow a property of another sprite, you can: launch { \n forever { \n set [my thing] to ((property) of (target)) \n } \n } or set [parent] to (target) \n inherit [property]