Only reason I ask for this, is I’m trying to automate setting the masks of collisionobjects based on their type. I have a module that lets me specify a full mask string for any collision group, and any object that calls “set_masks” on this module, provides its ID and group, will have all the masks set as per the collision matrix settings.
Essentially I’m kind of recreating what Unity already has - it has a matrix of checkboxes for which groups will collide with which groups. Without this, in Defold I need to set the masks property over and over for different groups which have to collide with the other groups that want to collide with it, which is open to human error. This automation is sensible to add - there’s no point in a collision group & mask that doesn’t have a matching reciprocal group mask pair that will collide with it.
Trouble is, I get “Collision group not registered” error when specifying a mask that hasn’t been officially set in any collisionobject settings. So I guess these values are all collected up by the engine and a global collision mask is created from all of those values. If the name never occours in any “group” or “mask” setting, it’s not available to be set with physics.set_mask
and I get the error.
The obvious workaround is for me to create a dummy object in the collection that has the group and masks that I want to be available.
Any thoughts on other ways to go about this? What if we could pre-set possible collision masks in the game.project settings under Physics?