Hi Brent ,
I make a Test Project but same bug …
even if everything is simplified I got this bug, the output write the print in the precollision but don’t call the rest …
I give you the whole project stuff :
local physics = require( "physics" ) physics.start() physics.setDrawMode( "hybrid") local \_x = display.contentCenterX local \_y = display.contentCenterY local Plat = {} local Platform local stage = display.currentStage local PlayerGround = display.newRect(0,0, 1100, 10) PlayerGround.x = \_x PlayerGround.y = 500 physics.addBody(PlayerGround, "static",{Friction=0.3, Bounce=0.1}) local Player = display.newRect (0,0,50,50) Player.x = \_x - 300 Player.y = 470 physics.addBody(Player, "dynamic", {Friction=0.3, Bounce=0.2}) Player.gravityScale = 15 Player.isFixedRotation = true function Player:preCollision( event ) -- EVEN IF I TAKE OUT THE CONDITIONAL CLASS THE BUG HAPPENED local class =event.other.class if class == "Transparent" then local PlayerBase = self.y + self.height/2 local MurTop = event.other.y - event.other.height/2 -- WHEN THE BUG HAPPENED THE PRINT IS CALLED BUT NOT THE REST if ( PlayerBase \> MurTop ) then event.contact.isEnabled = false --self.isSensor = true --self.setAsSensor = true print("through") end end end function Player:collision( event ) if ( event.phase == "began" ) then elseif ( event.phase == "ended" ) then --self.isSensor = false --self.setAsSensor = false end end local function doJump( event ) if event.phase == "began" then Player:setLinearVelocity(0 , -1200) elseif event.phase == "ended" then end end local function randomly () if Plat ~= {} then for x = #Plat, 1, -1 do display.remove( Plat[x] ) Plat[x] = nil end Plat = {} end for x = 1,3 do Platform = display.newRect(0,0,1150,25) Platform.class = "Transparent" physics.addBody(Platform, "kinematic",{Friction=0.3, Bounce=0.2}) Platform:setLinearVelocity(-500, 0) Plat[#Plat+1] = Platform end Plat[1].x = 1300 + 1500 Plat[1].y = 200 Plat[2].x = 1300 + 750 Plat[2].y = 300 Plat[3].x = 1300 Plat[3].y = 400 end timer.performWithDelay( 6500, randomly, 20 ) Player:addEventListener( "preCollision" ) Player:addEventListener( "collision" ) stage:addEventListener( "touch", doJump )