Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

parent rotation in collisions

Discussion in 'Scripting' started by morgansaysthis, Jun 20, 2007.

  1. morgansaysthis

    morgansaysthis

    Joined:
    Jan 12, 2007
    Posts:
    245
    how do i find the rotation of what i collided withs parent??
     
  2. bronxbomber92

    bronxbomber92

    Joined:
    Nov 11, 2006
    Posts:
    888
    function OnCollisionEnter(collision : Collision)
    {
    var rotation : Quaternion = collision.transform.parent.transform.position;
    }

    You might want to use root instead of parent if it's a longer hierarchy of objects and you're looking for the topmost object.
     
  3. morgansaysthis

    morgansaysthis

    Joined:
    Jan 12, 2007
    Posts:
    245
    sweet the root thing worked perfect, thanks