Hi, I ran into the constraint of corona sdk, how to get around it?
local function onLocalCollision( self, event ) if ( event.phase == "began" ) then print( self.myName .. " collision began with " .. event.other.myName ) wall.myJoint = physics.newJoint( "weld", wall, cactus, wall.x, wall.y ) end end image.collision = onLocalCollision image:addEventListener( "collision", image )
ERROR: C:\Users\Mark\Documents\Corona Projects\CactusMen\main.lua:143: physics.newJoint() cannot be called when the world is locked and in the middle of number crunching, such as during a collision event
The object must collide with the wall and “weld” to it. How to do this? I will be grateful for code examples