I’m trying to spawn in a simple rectangle object and just get it to move to the left but I can’t get Corona to recognize setLinearVelocity. It keeps saying that it’s a nil value. I don’t known why that is.
local function createBarrier() local barrier = display.newRect(mainGroup, 0, 0, 20, 100) physics.addBody(barrier, "kinematic") barrier.myName = "barrier" barrier:setFillColor(0, 1, 0) barrier.x = display.contentWidth barrier.y = display.contentHeight - 270 barrier:setLinearVelocity( 50, 0) table.insert( barriers, barrier) end