Similar to what borgb suggested I’d go with something like this:
local onUpdate = function(event)
if player and player.shouldBeTracked then
map:setPosition(player.x, player.y)
end
map:update(event)
end
Runtime:addEventListener("enterFrame",onUpdate)
Then have player.shouldBeTracked set to true when you first create your player object and as soon as a collision is triggered set it to false allowing the slideToPosition transition to work. Once you have done whatever you wish to do simply set it back to true again. Maybe after sliding the camera back to the player to make it look smooth. [import]uid: 5833 topic_id: 5038 reply_id: 22939[/import]