Search Unity

Sprite Animation changing rigidbody collider size

Discussion in '2D' started by LittleCodingFox, Aug 2, 2015.

  1. LittleCodingFox

    LittleCodingFox

    Joined:
    Jul 2, 2015
    Posts:
    11
    Hello, I have a sprite animation whose frames vary in size. However, I want the box collider attached to remain the same size on all frames. I noticed the Rigidbody component seems to be changing the size for those frames, however. Is there a way to prevent this?
     
  2. vakabaka

    vakabaka

    Joined:
    Jul 21, 2014
    Posts:
    1,154
    pick up the gameobject, open the animation window (ctrl-6 ? ), and try to delete the keys, wich change the rigidbody ?
     
  3. LittleCodingFox

    LittleCodingFox

    Joined:
    Jul 2, 2015
    Posts:
    11
    The only change is the sprite, so I don't think I can do that.
     
  4. vakabaka

    vakabaka

    Joined:
    Jul 21, 2014
    Posts:
    1,154
    are you sure, that the collider changes his size ? The sprite and collider should be independently. You can change collider through animationkeys or script. Maybe there is other way, but i dont know them. Try delete collider and add new one.
     
  5. LittleCodingFox

    LittleCodingFox

    Joined:
    Jul 2, 2015
    Posts:
    11
    Yeah, I have only a rigidbody2d, collider, animator, and sprite, and during some animation frames the collider changes size.
     
unityunity