Hello Guest

Author Topic: Trigger for Advanced Collider?  (Read 3385 times)

TDippingSauce

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Trigger for Advanced Collider?
« on: December 05, 2014, 03:46:39 pm »
Hi, I'm using advanced collider for character collision box and also for hitbox, and this system is very useful.

Currently, to detect hitbox collision, I simply loop around every enemy gameobjects and use rect.overlaps().

Well, I have not much enemy objects so it's okay so far...but I hope if I could use trigger or something like that for more clean code.(Just like original Unity Box Collider system offers)

Is this feature supported?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Trigger for Advanced Collider?
« Reply #1 on: December 06, 2014, 02:04:14 pm »
The istrigger flag should propagate on the instance... but if it doesn't you might want to add one separate large trigger vs multiple trigggers on one object, it could work more efficiently if you have loads of these around...

And if you're using 2D physics, you can implement your own collision checking - eg. group by a grid then compare everything inside a grid, it will be way way more efficient than other options if done properly..