Hello,
I have 2 birds in my level collection both from the same game object file, just registered as one game object bird1 and bird2. For test purposes i tried to let the bird stop as soon as it hits the player. In reality both birds stopped regardless of which hit the player.
Player script checks for the hit
if message_id == hash("collision_response") then
if message.group == hash("enemy") then
msg.post(message.other_id, "get_atk")
print(message.other_id)
end
end
Print returns DEBUG:SCRIPT: hash: [/bird1.go], so that’s working correctly
bird script
if message_id == hash("get_atk") then
cd_atk = 3 -- here I set a cooldown for the bird movement
end
if cd_atk <= 0 then
move = go.get_position() - dif * (dt / dif_length * 450)
go.set_position(move)
end