How do I refer to the collision object?

0 favourites
  • 3 posts
From the Asset Store
112 High-Quality destruction sounds for videogames
  • Hey!

    I am using for Construct 2 for quite some time now, but I never got this issue solved.

    When I have 2 players colliding, both sharing the same sprite, how do I know which one I am referring to?

    E.g. "Player on collision with Player", is there any way without having to check for a variable every time?

    In Unity you have Player and then you have the "collision" GameObject. So when you and the other player collide, "collision" always refers to the other, while in C2 you can not do that for what I know.

    Sure you can do something like: "If ID == 1" then do smth, but is there any other way to refer to a certain instance of the collision?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the normal way to handle this is to put the player in a family. then check for when the player collides with the family. The player object will be the one that caused the collision and the family object will be the one collided with.

  • the normal way to handle this is to put the player in a family. then check for when the player collides with the family. The player object will be the one that caused the collision and the family object will be the one collided with.

    Thanks, that sounds interesting, didn't know about that. Does the family really only refer to the collision, even though the player is also in the family?

    And what when you want to make PlayerFamily collide with PlayerFamily? Or do you even need that?

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