Static stuff and Collisions Help Needed

Hi, so I was trying to make an object stay at the center of the screen and if anything hit the object its supposed too bounce off it but I think since I put “static” in my physics.addBody the whole thing doesn’t work.

The lollipop stays in the middle of the screen but when my ball physic object goes to it, the ball doesn’t hit it, it just goes right through the lollipop.

Any ideas?

[lua]–lollipop
physics.addBody( lollipop, “static”, { gravity = .1, friction=0.3, bounce = 0.3 } )

–ball
physics.addBody( ball, “static”, { gravity = .1, friction=0.3, bounce = 0.3 } )
[import]uid: 54001 topic_id: 10161 reply_id: 310161[/import]

Hard to tell from the two bits of code you posted. But the first question better programmers then me will ask is; are they placed in the same group? [import]uid: 59387 topic_id: 10161 reply_id: 37097[/import]

there is no collision between two static objects make any one to dynamic (i suggest ball) after that it will work as ur expectation

:slight_smile: [import]uid: 12482 topic_id: 10161 reply_id: 37103[/import]

here is my line of thought…

since both objects were defined as “static” it probably means, that the “ball” object is being animated programmatically than letting physics engine doing it.

In that case even making ball dymanic won’t really help. Just my guess…

[import]uid: 48521 topic_id: 10161 reply_id: 37110[/import]

hi chinmay actually it will not cause any problem how you are moving Ur object whether pro grammatically or with the physics apis
but always there is no collision events occur if ur both objects are static if any one is dynamic it can occur dont know about kinematic as corona assums that all static objects are not moving and may be not chking for them

:slight_smile:
[import]uid: 12482 topic_id: 10161 reply_id: 37111[/import]

last time i checked, if you manually set coordinates of physics object, it ignores the physics until you “release” the object to physics engine… [import]uid: 48521 topic_id: 10161 reply_id: 37118[/import]