As with most food, steady even heat is key. If you're making them on the grill, let it preheat fully before putting the foil packets on it. If you're making them over the campfire, ensure that you have hot coals from an established fire under the grate. Don't put the foil packets over wood that is giving off steady flames as that will deliver uneven heat and may cause them to burn.