When first triggered the health pack starts dropping for every enemy after that

1 favourites
  • 8 posts
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • it works fine until its triggered then it just keep dropping at 100% rate

  • You didn't share where the function is being called. Use Browser log action to log the values, it will help you determine if they are as expected.

  • You didn't share where the function is being called. Use Browser log action to log the values, it will help you determine if they are as expected.

    In Debugger spawn chance values are changing correctly too

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • bump bump

  • Ah ok looks like maybe picking issue. If a skeleton dies, you need to spawn the item on a skeleton (the one you picked on death), not 'family enemy'.

    If you called the function on family enemy 'death animation finished', then using family enemy again in the function is fine and makes sense.

    The function also needs to have 'copy picked' enabled in its setting so that it keeps the picked instance between the original call and inside the function.

  • I still cant figure it out, nonmatter what I do every enemy just keeps dropping it after it strikes the first time

  • Ah ok looks like maybe picking issue. If a skeleton dies, you need to spawn the item on a skeleton (the one you picked on death), not 'family enemy'.

    If you called the function on family enemy 'death animation finished', then using family enemy again in the function is fine and makes sense.

    The function also needs to have 'copy picked' enabled in its setting so that it keeps the picked instance between the original call and inside the function.

    any other ideas?

  • You don't need the pick random instance btw, the death animation condition is fine. Maybe it's because of how you are using the health pack variable to determine spawning of another health pack. Change the spawnchance thing to a global variable and use this instead.

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