How do I fix this issue with collision and instance variable

0 favourites
  • 2 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Good Day,

    first of all, my name is Garry. I brought Construct 2 couple of days ago at steam. But at this point i encounter a problem that is way to big for me to solve alone.

    I have an instance variable with its given value of 60 (EnemyHP)

    I also have an instance variable for a bullet with the value of 12 (BulletDMG)

    pseudoscript:

    if bullet hits enemy

    {

    subtract BulletDMG from EnemyHP

    };

    So if i let the bullet angle at my enemy, everything works fine and the enemy gets 12 damage in this case. Left with 48 my turret keeps firing until the enemy has 0 hp left and the turret stops shooting.

    But.... if i have one or more enemys at the exact same position the damage becomes enormous and die at once from a single shot. if i spawn an enemy again(just one) everything is fine.

    Since i used instanced variables every enemy has its own value, right? It should not happen, why does the game or constrcut subtract more than one time the value, it seems like it calculates everything together and then simply subtracts this, or it does the collision substance multiple times. I dont encounter lags or something but at this point i might consider its a bug. hopefully not.

    Thanks for reading, waiting for your answer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Probably a picking issue. Can you post a CAPX for people to look at? If you can't post/upload yet you can use Dropbox and just add a few spaces in the address so the forum doesn't block it.

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