2D Toolkit Forum

2D Toolkit => Support => Topic started by: hromoydron on March 12, 2013, 09:31:58 am

Title: Trigger and Sprite
Post by: hromoydron 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?


Title: Re: Trigger and Sprite
Post by: unikronsoftware 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.
Title: Re: Trigger and Sprite
Post by: hromoydron 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?
Title: Re: Trigger and Sprite
Post by: unikronsoftware 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.
Title: Re: Trigger and Sprite
Post by: hromoydron on March 12, 2013, 06:45:37 pm
Thanks, I understand my mistake.
Title: Re: Trigger and Sprite
Post by: hromoydron 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?
Title: Re: Trigger and Sprite
Post by: unikronsoftware 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.