Search Unity

Can someone help me?

Discussion in 'Editor & General Support' started by theave8tor, Sep 24, 2010.

  1. theave8tor

    theave8tor

    Joined:
    Sep 14, 2010
    Posts:
    29
    Hi,

    I was wondering if somebody could explain to me the way parenting works, and how if I wanted to make a "tank" game I could make bullets shoot from the end of the barrel instead of from the center of the object.

    Thanks guys/gals!

    Grant
     
  2. AkilaeTribe

    AkilaeTribe

    Joined:
    Jul 4, 2010
    Posts:
    1,149
    Parenting uses differents actors : parents and child.

    When a parent move, all his children move exactly like the parent. So, a child, from the point of view of his parent, will never move from his position (again, from the point of view of the parent).

    The inverse is false, if a children is moved, it do not affect the parent.

    You can make an empty game object, located at a barrel, and set as a child of that barrel. It is then easier to spawn bullets, you retrieve the empty game object position (it will always stay at the barrel).
     
  3. theave8tor

    theave8tor

    Joined:
    Sep 14, 2010
    Posts:
    29
    Thanks! Very good way of explaining it!
     
unityunity