How to check the objectCollision that send message? (SOLVED)

Ok,

In this specific case, your dino is checking for the hero, and NOT the hero for the dino, so the collisions that will be sent as sender will be you dino’s, that is why you receive “collisionobject” as your sender.

So if you want to know if you hero’s feet got bitten, you have to put code in your hero’s script, then you will be able to receive the hero’s collisions as senders.

Try this in your hero.script:

if message_id == hash("contact_point_response") then
       if message.group == hash("dino") then
	 		print("message sender: " .. sender)

and your result will be something like:
DEBUG:SCRIPT: message sender: [main:/hero#foot_girl]

3 Likes