I have been making a game where when you hit cheese, it goes to a random position and the score goes up by 1. Every time the mouse touches the cheese however, the collision happens twice. I am having trouble making it only happen once. Here is the script.
function init(self)
cheese_score = 0
msg.post("@system:", "set_update_frequency", {frequency = 60})
end
function on_message(self, message_id, message)
if message_id == hash("trigger_response") then
cheese_score = cheese_score + 1
print(cheese_score)
go.set_position(vmath.vector3(math.random(1,1280), math.random(1,720), 1))
end
end