Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Moving an object along the axis of another object.

Discussion in 'Scripting' started by RaulG, Jan 29, 2015.

  1. RaulG

    RaulG

    Joined:
    May 31, 2013
    Posts:
    74
    I've been searching for ways to do this for quite a while, but most of the leads I found were completely dead ends.

    So depending on where the Y axis is pointing on the object, it'll send another object down that axis.

     
  2. gamer_boy_81

    gamer_boy_81

    Joined:
    Jun 13, 2014
    Posts:
    169
  3. RaulG

    RaulG

    Joined:
    May 31, 2013
    Posts:
    74
    THATS IT!!

    GOD MAN!

    THANK YOU SO MUCH!!!



    Now what if I want to do it with multiple objects?

    Same idea, each one of the shooted objects follows the axis of the object its shot from?
     
    Last edited: Jan 29, 2015
  4. RaulG

    RaulG

    Joined:
    May 31, 2013
    Posts:
    74
    Anyone?
     
  5. RaulG

    RaulG

    Joined:
    May 31, 2013
    Posts:
    74
    Hello?
     
  6. 2dfruity

    2dfruity

    Joined:
    May 1, 2014
    Posts:
    75
    build a list of the objects, when one is fired, set a bool on the object to true.
    have a for loop look through the list for the next true bool. set that object's axis as the follow axis/transform.
    obviously the first one should look to see if all the bools in the list are false before it is fired or it wont.