Search Unity

Do not move the collider

Discussion in '2D' started by Deleted User, Sep 23, 2018.

  1. Deleted User

    Deleted User

    Guest

    Please , help!I have a sprite with a collider that should work as a button. So it is, but only when it is not a child object. And I need the button to follow the character, and there is no other way to make the button a child. I'm sorry for the clumsy English .
     
  2. vakabaka

    vakabaka

    Joined:
    Jul 21, 2014
    Posts:
    1,153
    Show us something ;) Script, hierarchy, etc....

    other way: you can make follow object with script.
    Code (CSharp):
    1. public GameObject thisThingwillBeFollowed;
    2.  
    3. void Update () {
    4. transform.position = thisThingWillBeFollowed.transform.position;
    5. }
    Place the script on the "button" and put in its field the object which should be followed (you can make an empty gameobject as child from the player for position).