# Collision mask and group exposure patch

**URL:** <https://blenderartists.org/t/collision-mask-and-group-exposure-patch/560888>\
**Category:** Game Engine Support and Discussion\
**Created:** [December 30, 2012, 3:17pm UTC](https://blenderartists.org/t/collision-mask-and-group-exposure-patch/560888 "2012-12-30T15:17:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![agoose77](https://blenderartists.org/user_avatar/blenderartists.org/agoose77/32/442949_2.png) [@agoose77](https://blenderartists.org/u/agoose77)\
**Post date:** [December 30, 2012, 3:17pm UTC](https://blenderartists.org/t/collision-mask-and-group-exposure-patch/560888/1 "2012-12-30T15:17:20Z")

</div>

Hey everyone. I needed to access the group and mask data for KX\_GameObject collision data, so I exposed it to the API:  
[http://projects.blender.org/tracker/index.php?func=detail&aid=33710&group\_id=9&atid=127](http://projects.blender.org/tracker/index.php?func=detail&aid=33710&group_id=9&atid=127)

Feel free to test it and tell me what you think.

It accepts a bitmask as the new collision mask / group. I’ve written a wrapper for that purpose which I can include in the resources forum, although it’s simple binary so not too hard.

attributes:

- KX\_GameObject.collisionMask - the collision mask of the object
- KX\_GameObject.collisionGroup - the collision group of the object

For those who don’t know what this might be used for; I’m using it to disable enemy collisions upon death. You cannot use replaceMesh with physics types other than triangleMesh on the source object, and thus I am using this patch to enable me to set the enemy to no collision (by setting either the mask or group to 0)

---

<div class="post-metadata">

**Author:** ![agoose77](https://blenderartists.org/user_avatar/blenderartists.org/agoose77/32/442949_2.png) [@agoose77](https://blenderartists.org/u/agoose77)\
**Post date:** [December 30, 2012, 7:00pm UTC](https://blenderartists.org/t/collision-mask-and-group-exposure-patch/560888/2 "2012-12-30T19:00:06Z")

</div>

Also, if anyone gets a build working, could they check if it behaves correctly? SVN Trunk is misbehaving for me, even before I patch.

---

<div class="post-metadata">

**Author:** ![agoose77](https://blenderartists.org/user_avatar/blenderartists.org/agoose77/32/442949_2.png) [@agoose77](https://blenderartists.org/u/agoose77)\
**Post date:** [January 1, 2013, 9:59am UTC](https://blenderartists.org/t/collision-mask-and-group-exposure-patch/560888/3 "2013-01-01T09:59:43Z")

</div>

Anyone able to test the patch? I am having issues with Trunk.

---

<div class="post-metadata">

**Author:** ![MarcoIT](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@MarcoIT](https://blenderartists.org/u/MarcoIT)\
**Post date:** [January 2, 2013, 9:02am UTC](https://blenderartists.org/t/collision-mask-and-group-exposure-patch/560888/4 "2013-01-02T09:02:33Z")

</div>

when you see in the binary(??? really?) code , you can check also to solve the preistoric(very old) bug of the dynamic obj that becoming static (for ever) when here parented to another obj ?  
(or maybe if there a way to change physic for all obj during runtime that should be also more cool :D)  
(sorry if i m a bit Off Topic)
