Collisons Not Working (SOLVED)

Hello everyone.
Getting ahead with my creation of space shooter in Defold. Progress is really nice, but there is a thing that troubles me. While developing a collision response system for the bullet, the bullet is responding to collision response with enemies but not with asteroids.
Here are the ss:

``
and my code:

function on_message(self, message_id, message, sender)
	if message_id == hash("collision_response") then
		if message.group == hash("enemy") then
			print("caughtout")
		elseif message.group == hash("asteroids") then
			print("a")
			go.delete()
		end
	end
end

It does print caughtout but not a,neither does it delete itself. Moreover, the asteroids react on hitting player, as expected.
Where am I going wrong?
BTW: Thanks in advance…

1 Like

It looks like you need to add “astroids” to the mask list of the bullet as well, since it needs to be specified on “both ends”.

So update the mask of the bullet collision object to; “enemy, asteroids”

3 Likes

Oww, how can I be so silly.:astonished::astonished: It works Now.
Thanks man…Else I would have kept wondering what had happened to the collisions.

1 Like