Not sending message in message.other_id

As far as I understand message.other_id is exactly the id of the object with which the collision occurs.

When I use print(message.other_id) the program prints the collision with the desired object, but it does not send a message to it

function on_message(self, message_id, message, sender)
	if message_id == hash("contact_point_response") then, "kill")

	if message == hash("kill") then
		print("message enter")

When I ask the object that should receive the “kill” message to output the name of the object it already encounters, I get “/instance0”. Is it something to do with the fact that I generate the first object (sending the message) using the factory ? (And he can’t send him a message either.)

	if message_id == hash("contact_point_response") then

In general, are there any peculiarities with message.other_id factory elements ?

Shouldn’t it be message_id and not message?

if message_id == hash("kill") then

Thanks a lot for the reply ! I really didn’t notice the use of message_id when receiving a message.

1 Like