Access object collision group

How to access the game object GameObjectSettings collision_group ?

group = object.gameObjectSettings.collision_group

Says KK_gameobject has no groupd = object.gameObjectSettings.collision_group.

= an object ingame

so - gameObjectSettings

and you get


i have never used it so can be wrong, but this is my guess

you can also print out all the commands an object or anything has with using dir()


This is the what i tried also

if Collision.positive :
for object in Collision.hitObjectList :

I get error KX_gameobject has no attribute collision_group.

Nevermind, i can use some gameobject property to detect is this is environment objects collision or something else, but this would have been cool to be able to read collision_group.

with Cotaks code “print(dir( object ))” you can check attributes
try it…
and give a try to “object.collisionGroup” instead of “object.collision_group”

1 Like