That worked! I tweaked it to my liking but your method worked! Thanks a bunch!
–SonicX278
That worked! I tweaked it to my liking but your method worked! Thanks a bunch!
–SonicX278
You’re most welcome 
Hey! I have another question. With this code. How would i go about detecting a collision?
local physics = require("physics") physics.start() local centerX = display.contentCenterX local centerY = display.contentCenterY local actualW = display.actualContentWidth local actualH = display.actualContentHeight local bullet = {} local bCounter = 1 local bTimer local i = 1 local wallLeft = display.newRect( centerX - actualW/2 + 20, centerY, 10, actualH ) wallLeft.myName = "wallLeft" local wallRight = display.newRect( centerX + actualW/2 - 20, centerY, 10, actualH ) local wallTop = display.newRect( centerX, centerY - actualH/2 + 20, actualW, 10 ) local wallBottom = display.newRect( centerX, centerY + actualH/2 - 20, actualW, 10 ) local function bob() if #bullet \>= 1 then print("hi") end return true end local function shootBullet(event) local xB = math.random( -359, 359 ) local yB = math.random( -359, 359 ) bullet[bCounter] = display.newRect( centerX, centerY, 6, 6 ) bullet[bCounter].value = bCounter physics.addBody( bullet[bCounter], "dynamic", { isSensor = true } ) bullet[bCounter].gravityScale = 0 bullet[bCounter].myName = "bullet" bullet[bCounter]:setLinearVelocity( -100 , 0 ) bCounter = bCounter + 1 end bTimer = timer.performWithDelay( 100, shootBullet, 1 ) Runtime:addEventListener( "enterFrame", bob )
–SonicX278
Is it even possible?
–SonicX278
It is of course possible 
You’ll want to do one of two possible options:
A runtime listener for collisions that handles all physics objects
Per object listeners for collisions.
In that listener you would do the following:
Add a physics body to each of your walls.
In your collision listener, if the bullet collides the wall then destroy it.
Take a look at the following guide: https://docs.coronalabs.com/daily/guide/physics/collisionDetection/index.html