Offscreen Physics - Collision Detection

Hi Dyson,

Thanks for the great work, everything is really coming together for me with the mte.  A quick question

I have set offscreenPhysics to true for my sprites:

local setupSun = {kind = “sprite”, layer =  mte.getSpriteLayer(1), locX =params.itemx, locY =params.itemy, levelWidth = 190, levelHeight =190, offscreenPhysics=true}  

I have a collision event between my sun object and my player.

When I touch scroll the map so that these objects which are colliding are off the screen, the collision ends.  When I scroll the map back so they are visible again, I get another collision event generated.

Is there a way to keep the collision events from stopping / starting?

Thanks, Greg

Just to be clear, do both objects have offscreenPhysics enabled? If one of them doesn’t then MTE will turn it off when it leaves the screen and no collisions will occur. As far as I’m aware a collision event cannot take place between two objects when one of them is set to inactive, i.e. it’s isBodyActive property is false.

ummm… i suppose enabling offscreenPhysics for my player might help in making offscreen physics work…

works great now… thanks dyson!

Just to be clear, do both objects have offscreenPhysics enabled? If one of them doesn’t then MTE will turn it off when it leaves the screen and no collisions will occur. As far as I’m aware a collision event cannot take place between two objects when one of them is set to inactive, i.e. it’s isBodyActive property is false.

ummm… i suppose enabling offscreenPhysics for my player might help in making offscreen physics work…

works great now… thanks dyson!