Attempt to index upvalue "physics" (a nil value)

In my game i am simply trying to make the physics of a certain character start later on in the game to do that i simply create a function which contains the physics.addBody code and have a timer.perform with delay underneath of it. When the game finishes a button shows on the screen, when i click it during the transition it displays this error, could someone help me here?

local function spawnCharacter() physics.addBody( character1, "dynamic", {filter=guyCollisionFilter} ) end timer.performWithDelay( 10000, spawnCharacter, 0 ) 

That is where the error occurs, if you need more code let me know.

Are you requiring the physics module in that code?

local physics = require(“physics”)

http://developer.coronalabs.com/content/game-edition-box2d-physics-engine

Yes I am requiring it

This error points to a likely scoping error. If this is a separate scene, did you require the physics library in this particular scene? Are you “overwriting” the physics library with another variable or function? Did you require it as SegaBoy indicated, case-sensitive, assigned to a variable?

Best regards,

Brent Sorrentino

Are you requiring the physics module in that code?

local physics = require(“physics”)

http://developer.coronalabs.com/content/game-edition-box2d-physics-engine

Yes I am requiring it

This error points to a likely scoping error. If this is a separate scene, did you require the physics library in this particular scene? Are you “overwriting” the physics library with another variable or function? Did you require it as SegaBoy indicated, case-sensitive, assigned to a variable?

Best regards,

Brent Sorrentino