Instance '/Enemies' could not be found when dispatching message

I get this error:

Instance '/Enemies' could not be found when dispatching message

From this piece of code:

function on_message(self, message_id, message, sender)
	if message_id == hash("collision_response") then 
		local collided_object_id = message.other_id

		if message.group == hash("pizza") then 
			print("Collision with pizza")
			go.delete(collided_object_id)
		elseif message.other_group == hash("enemy") then
			print("Collision with enemy")
			msg.post("/Enemies#countdown", "enemy_dead") 
			go.delete()
			go.delete(collided_object_id)
		end
	end
end

This is my file setup:

image

I have tried debugging using printing and researching, i have tried removing the slashes and hashtags, using only hashtags, only slashes, and it still doesn’t work.

Any help?

It looks like “Enemies” is a folder?
Folders aren’t part of the actual game, so you need to figure out the name of the gameobject that the script is attached to.

2 Likes

Thanks! That worked.

1 Like