Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

2D Colliders, how do you cope with different sized sprites?

Discussion in '2D' started by raycosantana, May 24, 2014.

  1. raycosantana

    raycosantana

    Joined:
    Dec 23, 2012
    Posts:
    319
    I have these sprites I'm using, the problem is most of them are 64x64 but some are a little bit taller (76x64), the thing is when I create the animations the colliders don't match in the animation of the sprites that are a little bigger, my obvious instinct was to resize the collider on the those animations but that makes the character sort get stuck for a second when transitioning to from the normal sized sprites animations to the bigger sized sprites animations and viceversa, I also tried moving collider down instead but got the same result.

    $collider size.jpg

    How can I fix this?, Thanks!
     
    Last edited: May 24, 2014
  2. peterdeghaim

    peterdeghaim

    Joined:
    Apr 10, 2014
    Posts:
    154
    Have you tried using a polygon collider? Also, in order for your character to move smoothly I HIGHLY recommend you put a circle at the bottom of your character (the legs and feet). This allows your character to move swiftly across slopes and what not.
     
    Last edited: May 24, 2014
  3. raycosantana

    raycosantana

    Joined:
    Dec 23, 2012
    Posts:
    319
    Well no, but because I cant, I'm using a 2D character controller created by a another person I only can use box colliders or it wont work, I know about using circle colliers I have done that in the past, but like I said I cant use them. Not using this Character controller is out of the question as it offers advanced features It would take me months design and code by myself.

    Thanks for the reply!
     
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Can you set up box colliders at the left and right edges of the main box, which are horizontally spring loaded, so that they become `squishy`?