# How to find a game objects collision group?

**URL:** <https://forum.defold.com/t/how-to-find-a-game-objects-collision-group/14785>\
**Category:** Questions\
**Created:** [December 17, 2017, 8:07am UTC](https://forum.defold.com/t/how-to-find-a-game-objects-collision-group/14785 "2017-12-17T08:07:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bill.northcott](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@bill.northcott](https://forum.defold.com/u/bill.northcott)\
**Post date:** [December 17, 2017, 8:07am UTC](https://forum.defold.com/t/how-to-find-a-game-objects-collision-group/14785/1 "2017-12-17T08:07:21Z")

</div>

hiya,

I’m making an infinite runner sorta thing. theres a player, jumps, and rocks. if you collide with a jump, you jump, and if you collide with a rock, you die/fall/whatever. heres my code to do with triggering a jump -

```lua
function on_message(self, message_id, message, sender)
	
	if message_id == hash("collision_response") then 
               --if you're not jumping already then do a jump
		if self.jump == false then
			self.jumpspeed = self.yspeed/20
			self.jump = true
		end
		
	end
end

```

But the problem is the same thing happens when you hit a rock, or anything with a collision object on it. so how do i make this only happen if the thing you’re colliding with is in the collision group “jumps” ? Is that the way i should handle this? or is there some other way this is meant to work?

---

<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:** [December 17, 2017, 10:03am UTC](https://forum.defold.com/t/how-to-find-a-game-objects-collision-group/14785/2 "2017-12-17T10:03:20Z")

</div>

Hi @bill.northcott!  
In the documentation for [collision\_response](https://www.defold.com/ref/physics/#collision_response:other_id-other_position-other_group-own_group) you’ll find `message.other_group` which should do what you want.
