Hello Guest

Author Topic: Question about box colliders  (Read 8225 times)

Disastercake

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Disastercake
Question about box colliders
« on: May 27, 2012, 03:50:22 am »
It took a little playing around with for me to get the physics (kind of) working, since the only video I could find on the subject is outdated (http://www.youtube.com/watch?v=29zU5jz4S8w), but I eventually got it working.  I have a few questions though:

Does the box collider settings in the normal box collider settings matter?  Or does it only matter what is defined in the editor and the box collider component just tells 2D Toolkit to look at the predefined colliders made in the editor?

If I make a custom shape, how can I transfer that custom shape to other frames?  It's very annoying to have to manually go by hand and set each custom box collider.

Thanks! =D
« Last Edit: May 27, 2012, 04:01:53 am by Disastercake »
Working on Soul Saga, an upcoming anime adventure RPG game by Disastercake.
www.disastercake.com

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Question about box colliders
« Reply #1 on: May 27, 2012, 02:58:03 pm »
There is a bit more info here. We're trying to keep the docs as up to date as possible, its much harder with the videos.
http://unikronsoftware.com/2dtoolkit/doc/tutorial/Attaching_a_collider_to_a_sprite.html

The normal box collider settings are set by the sprite. So, just set up what you need in the editor, and let it manage the collider for you. Thats probably the best way to go about this, as the collider gets updated with frames, etc.

If you want to make a custom shape, simply multi select in the editor (1.60 onwards), and edit the collider on the visible one. After you're happy with it, click on "Apply" to apply it to all the other selected ones.


Disastercake

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Disastercake
Re: Question about box colliders
« Reply #2 on: May 27, 2012, 06:11:21 pm »
Thank you for the response! =D

I'm having an issue where if I choose custom box, it will visually cut off part of my sprite that is not in the bounding box.  However in most games the collision is not pixel perfect and is often smaller than the sprite.  How would I make a collider smaller than the sprite itself?
Working on Soul Saga, an upcoming anime adventure RPG game by Disastercake.
www.disastercake.com

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Question about box colliders
« Reply #3 on: May 27, 2012, 11:18:26 pm »
Thank you for the response! =D

I'm having an issue where if I choose custom box, it will visually cut off part of my sprite that is not in the bounding box.  However in most games the collision is not pixel perfect and is often smaller than the sprite.  How would I make a collider smaller than the sprite itself?

What version of 2D Toolkit are you on? Just checked on latest trunk version and you can certainly have colliders smaller than the sprite itself.

Disastercake

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Disastercake
Re: Question about box colliders
« Reply #4 on: May 28, 2012, 05:17:55 am »
1.7 final + patch 2.  Is this the most recent?
Working on Soul Saga, an upcoming anime adventure RPG game by Disastercake.
www.disastercake.com

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Question about box colliders
« Reply #5 on: May 28, 2012, 08:50:29 am »
That is the most recent non-beta version. Could you send me a repro case of this, as I don't seem to be able to reproduce it on the same version?
support at unikronsoftware dot com