0 Favourites

How do I prevent a family from colliding with itself

  • Ok, so i had made a character with the ragdoll type method, so i had separate sprites for arms, legs, body ,head etc... Pinned them to each other and all was fine. Now this was before i bought C2 so there was no family option for me. i wanted the body parts to not collide with each other as it made the ragdoll go haywire. So i had to do the tedious task of disabling physics collisions of each part with the other. Which worked and the ragdoll didn't go mental crazy.

    Then i bought C2 and hooray i said as i created a family with all the body parts in the family, and i put a physics behavior for the family, which shows up as Physics2(if anyone can also explain as to why it is shown as Physics2) so i could disable family colliding with family(itself). But it didn't work. The ragdoll went nuts as the first time it did before disabling physics collisions.

    Is this not the way to prevent family on family collision?, Is there another method?.

    It works if i prevent each sprite of the family to disable physics collision with it's family, which is fine but it would be nice if it could be done with just 1 event instead of 10 or so events.

  • Physics2 is shown because you have 2 physics behaviours on your object (or had at some point), if your object is in a family that has the physics behaviour added to the family, there's no need for the object type to also have a physics behaviour.

    I haven't tested it yet but I ran across a similar problem for checking overlapping between objects of the same family, the solution people here gave me was to duplicate the family (have all the same object in 2 families) and disable stuff between family 1 and it's clone

  • Family1 disable physics2 collision with Family2(duplicate). Well i tried that and had the same problem. Guess it's not such a big issue to have an extra 10 events. I can live with that. But if it were an extra 100 events vs just 1 then i would be bursting my brains out. Thanks anyways.

  • Family1 disable physics2 collision with Family2(duplicate).

    That's weird, it works for me.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hmm don't know what i'm not doing right. One thing i realized was, when i reverted back to my disable each individual object's physics collision with family event, it was going haywire again. I was confused as it worked before and now even this method is not working, Then i realized i did not delete the physics behavior for the family, Having the physics behavior on for the family caused the crazyness. It was fine after deleting the physics behavior for the family. Maybe it's cause the sprites in the family also have physics behavior. Thanks anyways mate.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)