Hello Guest

Author Topic: Trigger and Sprite  (Read 5478 times)

hromoydron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
Trigger and Sprite
« on: March 12, 2013, 09:31:58 am »
Hello!
I want to make a trigger from my Sprite.
I added rigid body and unity box collider. It's work.

But, as I understand, in sprite collection editor 2dtk have it's own collider. How can I make a trigger from 2dtk collider? how can I male a polygon trigger?



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Trigger and Sprite
« Reply #1 on: March 12, 2013, 10:33:09 am »
The sprite collection editor simply creates Unity colliders anyway, so you will be fine. Just remember, if you need to create polygon (mesh) colliders, make sure to create a cap in the sprite collection editor if you need to interact from the z axis, eg. click it, or otherwise need a closed volume.

hromoydron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Trigger and Sprite
« Reply #2 on: March 12, 2013, 01:02:06 pm »
May be it for my bad English, but I've still not understood  yet, how can I make a trigger. In Unity Colliders I simply checked "is Trigger". But in sprite collection there isn't such option. What should I choose/check? or I can make sprite trigger only in code?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Trigger and Sprite
« Reply #3 on: March 12, 2013, 01:24:56 pm »
Once you have created the sprite, tick the "Is Trigger" checkbox on the collider. That's it. It should remember that setting.

hromoydron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Trigger and Sprite
« Reply #4 on: March 12, 2013, 06:45:37 pm »
Thanks, I understand my mistake.

hromoydron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Trigger and Sprite
« Reply #5 on: March 12, 2013, 10:16:14 pm »
In my scene if triggers collided they will stop immediately. If mesh trigger collide with box trigger (or box with box ) all is okay. But mesh with mesh overlaps each other a little. 
Why can it be so?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Trigger and Sprite
« Reply #6 on: March 12, 2013, 10:28:28 pm »
Thats down to the Unity Physx system.
It does allow a tiny bit of penetration with mesh colliders, a bit more than with box colliders.
I've never needed to do what you're trying to here, but I would start exploring the physics settings in case one of them helps. Edit > Project settings > Physics.