When my object touches with multiple physical bodies at the same time my jump button stops working for my character. Say my object is on the ground then runs into a wall while still touching the ground or is being pushed by a joint of any type onto another surface the button stops working. It’s like the game doesn’t know what it’s touching anymore, so he can’t jump. I’m about to go crazy! My game works perfect until this collision error occurs. Please help!
This is everything I’ve tired:
Using Global vs. Local collision listeners
All of the following on my main character and objects
Body.isAwake
Body.isBodyActive
Body.isBuller
Body.isFixed Rotation
Body.isSensor
Body.isSleepingAllowed
I’ve tried switching my bodies from “static” to “kinematic” to dynamic.
I’ve played with the properties i.e. density, bounce, friction. Nothing on all objects.
This guy had the same problem as me I think. I tried what he did and nothing worked:
http://developer.anscamobile.com/forum/2011/02/07/physics-bodies-and-joints-no-collision-detection
Here’s my code for collisions:
[lua]local function onCollision(self, event )
if ( event.phase == “began” ) then
character.canJump = true
elseif ( event.phase == “ended” ) then
character.canJump = false
end
end
character.collision = onCollision
character:addEventListener( “collision”, character )
[import]uid: 46082 topic_id: 18524 reply_id: 318524[/import]