Search Unity

How to not move collider if the object it's attached to is moving with animator

Discussion in 'Scripting' started by petizero, Nov 4, 2019.

  1. petizero

    petizero

    Joined:
    Jan 1, 2019
    Posts:
    47
    So i have a topdown project where my doors work by sliding to the side the problem with it is that it moves the 2dbox collider.

    Is there a way to make only the object move but not the box collider?
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    Why not just make them separate objects?
     
  3. petizero

    petizero

    Joined:
    Jan 1, 2019
    Posts:
    47
    Kind of a newbie here i don't know how to reference that in the other script
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    I don't know what you mean. You already have the script to move the moving object, right? If you put the collider on a different object, then why does the moving object need a reference the that object?