Hello Guest

Author Topic: Animated Sprite collider not being created properly  (Read 5371 times)

ERR0

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Animated Sprite collider not being created properly
« on: November 27, 2012, 07:34:44 pm »
So I have a number of tk2d animated sprites and when I click the "create a collider" button on one of them in the editor, it creates a collider at (0, 0, -100000) with a size of (0, 0, 0). I assume this is a bug because I thought it's supposed to automatically position and size the collider. Is there something I'm missing or a way I can fix this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Animated Sprite collider not being created properly
« Reply #1 on: November 27, 2012, 07:51:33 pm »
That happens when you don't have a collider set up on the sprite itself. Go into the sprite collection editor, and set up a box collider on your frames.

This is so you can have frames of animations WITHOUT colliders, and other frames with colliders. What its thinking right now is that all frames don't have colliders.

ERR0

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Animated Sprite collider not being created properly
« Reply #2 on: November 27, 2012, 08:53:44 pm »
Awesome, that worked, thanks. Do I still need to check off the create collider checkbox on the animated sprite?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Animated Sprite collider not being created properly
« Reply #3 on: November 27, 2012, 10:40:36 pm »
Leave it on if your sprites have colliders. The real purpose of that is to create a hidden collider, for example if the default sequence didn't have colliders, but another one did.

xikky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Animated Sprite collider not being created properly
« Reply #4 on: January 31, 2013, 06:01:17 pm »
Thank you this one helped me too.

similar to this ... I cannot change the scale of a box collider on a sprite. The only way that the box collider can be scaled is by scaling the sprite itself. Am I missing something here?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Animated Sprite collider not being created properly
« Reply #5 on: January 31, 2013, 11:07:55 pm »
Isn't the box collider simply being animated? If you want to change it yourself, you probably want to set the collider type in the editor to unset / user defined.

xikky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Animated Sprite collider not being created properly
« Reply #6 on: February 01, 2013, 01:48:34 pm »
sorry I didn't explained my problem with enough detail.

I would like to scale the sprite's collider in the z axis. Thus making the box collider into a much longer rectangle. Should I set the collider type to user defined in this case (as you suggested above) or is there another way, to scale the collider only in the z axis? At the moment I can only fix the box collider width (at the z axis) by scaling the sprite's z axis.

Which would be the best practice for this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Animated Sprite collider not being created properly
« Reply #7 on: February 01, 2013, 02:13:38 pm »
Open up the sprite collection editor, in settings, set collider depth to what you'd like it to be. Commit, and you're done.