Intermittent collision issues

snortch

  • Posts: 25
I am seeing some strange intermittent collision issues in my game. I have setup collision groups to make it so that players collide with enemies and some specific tiles. I also setup a collision group so that my player's projectiles collide with the enemy and collide with some of the tiles. In addition, I setup terrain on the edges of my one scene so that the player cannot leave the scene.

The issue is that sometimes these collisions all work, and other times they don't. The one that’s the most confusing to me is the terrain boundary that I setup. I don't understand why it works sometimes and other times it doesn’t??

Anyone have any ideas what could be the cause of that?

Photon

  • Posts: 2691
Do different animations have different collision groups assigned to them?
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

snortch

  • Posts: 25
Good thought, but no they don't. This is the 2nd time this has happened to me. The first time it happened, I deleted the terrain and then drew new terrain boxes. Doing that fixed the problem.

Hmm, maybe I'll try that now...

snortch

  • Posts: 25
Now that's really weird. This time deleting the old terrain and putting in new terrain didn’t fix the problem.

After further experimentation and thinking, I remembered that I had changed the physics properties for the two actors that weren't colliding correctly. I changed them both from "Normal" to "Cannot be Pushed". It doesn’t make sense to me why changing that setting would somehow negate the collisions, but switching both actors back to "Normal" makes the collisions work as expected.

Anyone have any idea why this would be?

snortch

  • Posts: 25
Ok, found the answer to my own question:

http://community.stencyl.com/index.php/topic,6070.msg39122.html#msg39122

If I understand the above thread, it sounds like having "cannot be pushed" turned on messes with the way Box 2d handles collisions. Sounds like the suggestion is to  increase the mass of the object so that it cannot be easily pushed and leave the actor set to "normal".

« Last Edit: July 14, 2013, 01:49:58 pm by snortch »