Make object not be present until spawned in?

So how do I make it that when I start the game, a specific physics body is not already present, but only spawns in when I push a button

I am using this button here 

local physics = require("physics") physics.start() physics.setGravity( 0, 5) local eggplant = display.newImage( scene.perRunGroup, "images/eggplant.png" ) eggplant.x = 70; eggplant.y = 100 eggplant.myName = "eggplant" physics.addBody( eggplant, "dynamic", physicsData:get("eggplant") ) eggplant.collisionType = "eggplant" -------------Remove eggplant button local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) if event.phase == "ended" and eggplant.alpha ~= 0 then eggplant.alpha = 0 physics.removeBody(eggplant, "dynamic", physicsData:get("eggplant")) end if ( "ended" == event.phase ) then print( "Button was pressed and released" ) end end local removeeggplant = widget.newButton( { width = 80, height = 40, defaultFile = "images/level.png", overFile = "images/level.png", label = "", onEvent = handleButtonEvent } ) -- Center the button removeeggplant.x = 40 removeeggplant.y = 20 -- Change the button's label text removeeggplant:setLabel( "Remove" ) sceneGroup:insert(removeeggplant) -------------------------Add eggplant button local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) if event.phase == "ended" and eggplant.alpha ~= 1 then eggplant.alpha = 1 physics.addBody(eggplant, "dynamic", physicsData:get("eggplant")) end if ( "ended" == event.phase ) then print( "Button was pressed and released" ) end end local addeggplant = widget.newButton( { width = 80, height = 40, defaultFile = "images/level.png", overFile = "images/level.png", label = "", onEvent = handleButtonEvent } ) -- Center the button addeggplant.x = 150 addeggplant.y = 20 -- Change the button's label text addeggplant:setLabel( "Add" ) sceneGroup:insert(addeggplant)

what about you remove the 

physics.addBody( eggplant, “dynamic”, physicsData:get(“eggplant”) )

    eggplant.collisionType = “eggplant”

on line 8

  1. all your function have the same name, which they should not be. Every time you make new function or attribute you are making jar and when you use the same name you are cleaning out the jar and using it for something else.

what about you remove the 

physics.addBody( eggplant, “dynamic”, physicsData:get(“eggplant”) )

    eggplant.collisionType = “eggplant”

on line 8

  1. all your function have the same name, which they should not be. Every time you make new function or attribute you are making jar and when you use the same name you are cleaning out the jar and using it for something else.