2D Toolkit Forum
2D Toolkit => Support => Topic started by: TDippingSauce 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?
-
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..