[Resolved] Sprite added to physics engine, but not reacting....

I’m using this code:

local physics = require "physics"  
local sprite = require "sprite"  
  
physics.start( )  
local runningmansheet = sprite.newSpriteSheet("runner-nopowerups.png", 128, 128 )  
  
local runningmansheet = sprite.newSpriteSheet("runner-nopowerups.png", 128, 128 )  
sprite.add( runningman, "runningman", 1 , 15, 300 )  
runnerinstance = sprite.newSprite( runningman )  
runnerinstance.x = display.contentWidth / 4  
runnerinstance.y = ( display.contentHeight / 3 ) \* 2  
runnerinstance:prepare("runningman")  
runnerinstance:play( )  
  
physics.setGravity( 0, 9.8)  
physics.addBody(runnerinstance, "kinematic", { density=1.0, friction=0.3, bounce=0.3 } )  

By this code, the sprite should be “falling”, shouldn’t it?

However, there is no reaction. I’m not getting any sort of error; it runs just fine, but the sprite doesn’t seem to be reacting like a physics object. [import]uid: 147975 topic_id: 27284 reply_id: 327284[/import]

Hello, I think your problem is on line 16:

[lua]physics.addBody(runnerinstance, “kinematic”, { density=1.0, friction=0.3, bounce=0.3 } )[/lua]

Try removing “kinematic,” and see if that helps…

-Jake [import]uid: 144504 topic_id: 27284 reply_id: 110926[/import]

That worked! Thanks! [import]uid: 147975 topic_id: 27284 reply_id: 110927[/import]

No problem! =D [import]uid: 144504 topic_id: 27284 reply_id: 110928[/import]