Multiple Collisions Problem [SOLVED] :)

This forum is currently in read-only mode.
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • Hello there! I'm a new developer on the Construct software; I have switched to Construct after about 5 years developing on Clickteam's software. I think this development software is REALLY amazing, but I'm having a slight issue in the game I'm creating. In my game, which is a relatively simple platformer at the moment, you collect coins by--of course--colliding with them. My problem is that when two coins are close together, and the player touches both coins at the same time, the private variable 'Coins' only adds 1 to its collection instead of 2. Is there any way to fix this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello there! I'm a new developer on the Construct software; I have switched to Construct after about 5 years developing on Clickteam's software. I think this development software is REALLY amazing, but I'm having a slight issue in the game I'm creating. In my game, which is a relatively simple platformer at the moment, you collect coins by--of course--colliding with them. My problem is that when two coins are close together, and the player touches both coins at the same time, the private variable 'Coins' only adds 1 to its collection instead of 2. Is there any way to fix this?

    Can you post a cap?

    My thought is change to over lap. Try that that instead of collision.

  • I'm not sure what events exactly you used, but I assume you made it add when the player collides with the coin. Try the inverse, add 1 to the private variable when the coin collides with the player...

    Example:

    On collision between Coin and Player
    

    Player Add 1 to 'Coins'

    [/code:2fnofxk2]

    Instead of

    On collision between Player and Coin
    

    Player Add 1 to 'Coins'

    [/code:2fnofxk2]

  • I'm not sure what events exactly you used, but I assume you made it add when the player collides with the coin. Try the inverse, add 1 to the private variable when the coin collides with the player...

    Hmm... You were right, I did indeed have the player colliding with the coin, but when I switched it around it didn't fix the problem. However, when I combined it with Guyon's tip:

    My thought is change to over lap. Try that that instead of collision.

    ...It fixed the problem entirely. I ran multiple tests to see if it had truly fixed it, and it did. Thanks, guys!

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