I am working with physics. I use the code in this section to push the chicken back when it collides with the fences.
Because I have 2 shapes on the chicken 1 for the head and 1 for the body, the chicken stops at the head.
I want it to stop at the body like the second image
This is my code
function on_message(self, message_id, message, sender)
-- Handle collision
if message_id == hash("contact_point_response") then
local newpos = go.get_position() + message.normal * message.distance
go.set_position(newpos)
end
end