# \[SOLVED\] Is it possible to create collision object groups and masks at run-time?

**URL:** <https://forum.defold.com/t/solved-is-it-possible-to-create-collision-object-groups-and-masks-at-run-time/70621>\
**Category:** Questions\
**Created:** [March 28, 2022, 10:07am UTC](https://forum.defold.com/t/solved-is-it-possible-to-create-collision-object-groups-and-masks-at-run-time/70621 "2022-03-28T10:07:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 28, 2022, 10:29am UTC](https://forum.defold.com/t/solved-is-it-possible-to-create-collision-object-groups-and-masks-at-run-time/70621/2 "2022-03-28T10:29:40Z")

</div>

You can use the [physics.set\_mask\_group()](https://defold.com/ref/stable/physics/#physics.set_group:url-group) et.al to manipulate your groups/masks.

You can also enable/disable collision objects.

I think it’s probably a good idea for you to group your objects together (e.g. in a “squad”) once a collision between units has been detected, so that you can make then choose some new target position nearby (so they don’t overlap too much)  
E.g. there is [DefArmy](https://forum.defold.com/t/defarmy/63818) that does something like this.

---

_[View the full topic](https://forum.defold.com/t/solved-is-it-possible-to-create-collision-object-groups-and-masks-at-run-time/70621)._
