How do I avoid picking conflicts?

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Below is my code for handling player movement where if the player draws a line from a RedUnit it follows it and then destroys the line. It works perfectly... except for when it doesn't. The line (Marker & LineMove sprites) occasionally just don't delete after the movement either finishes or is interrupted with a collision. It fails about 10% of the time, and when it does only some Marker and LineMove sprites stay.

    Using Debug Layout it looks like the Marker and LineMove sprites are ID'd correctly, so I think there is only 1 other possible culprit that I can think of: the pick condition. Assuming I am right about this, how do I prevent the pick conditions from ever conflicting with one another?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't know if this will help, but in #16 you might need to move "Set isPaused to false" to the top of the event. Otherwise the whole event will execute several times before it stops. Avoid using "wait" actions in events that run on every tick!

    If that doesn't help, could you share your project file? It's difficult to understand what's going on by screenshots.

  • I don't know if this will help, but in #16 you might need to move "Set isPaused to false" to the top of the event. Otherwise the whole event will execute several times before it stops. Avoid using "wait" actions in events that run on every tick!

    If that doesn't help, could you share your project file? It's difficult to understand what's going on by screenshots.

    Here you go: https://drive.google.com/file/d/1Q8747Y-_vmOHinae9tWqPQpAQcP9JmVe/view?usp=sharing

  • When RedUnit collides with another RedUnit, both of them become isPaused. So event 16 processes two instances of them. And because the engine is so smart, it compares each Marker UnitID with a different RedUnit instance, alternating between them (I assume). As a result, some of the markers remain unpicked.

    Add "For each RedUnit" to event #16. You might need to do the same in some other similar events.

  • When RedUnit collides with another RedUnit, both of them become isPaused. So event 16 processes two instances of them. And because the engine is so smart, it compares each Marker UnitID with a different RedUnit instance, alternating between them (I assume). As a result, some of the markers remain unpicked.

    Add "For each RedUnit" to event #16. You might need to do the same in some other similar events.

    It works! I am absolutely buying you another coffee for this.

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