hey
i don’t doubt it’s something i’m doing, it’s just weird it started happening with the later builds…
i’ve narrowed it down to something specific i think
i precreate some weapons for my hero character like this…
[lua]for i=1,13 do
local asplode = display.newImage(Weapons.dg,“common/blam.png”,-100*i,-100)
asplode.power = 40
physics.addBody( asplode, “dynamic”, { density=1, friction=0, bounce=0 ,radius=explodo,isSensor = true,filter= {categoryBits = 16, maskBits = 269 }} )
–asplode.collision = Weapons.explosion
–asplode:addEventListener(“collision”, asplode)
asplode.id = i
asplode.isVisible = false
asplode.isBodyActive=false
Weapons.asplodes[i]=asplode
end
for i=1,5 do
local ms = display.newImage(Weapons.dg,“missile.png”,-100*i, -100)
physics.addBody(ms, “dynamic”, {friction=0.2,density = 0.50, bounce=0.0,radius = 16,filter = {categoryBits = 16, maskBits = 269 }})
ms.isBullet = true
ms.power = 125
ms.hitCount = 0
ms.isVisible = false
ms.isBodyActive=false
Weapons.missiles[i]=ms
– these are the lines that seem to cause the crash –
ms.collision = Weapons.hitRocket
ms:addEventListener(“collision”, ms)
end [/lua]
if i comment out the two lines relevant to the collision it won’t crash . if the lines are there then it crashes…
i’m a little unclear on the change - can i not use isSensor with a collision function?
cheers
[import]uid: 118333 topic_id: 30236 reply_id: 121191[/import]