[solved] Super Ubie Island 2 - Need help picking all instances

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Ubie's powerup is supposed to attract all coins within a certain radius.

    I am having a issue with getting all of the coins to behave properly. I've tried various things but the code above is what has gotten me the best results. But I still have an issue with a rogue coin every once in a while not cooperating.

    Any advice on how I could get this working?

    thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • instead of pick all instances id use for each coin and then compare two variables distance(coin.x,coin.y,character.x,character.y)<500 Set coin magnet true

    that should do the trick.

    also are you sure that coin on top is a normal coin? and not a UI coin? make sure all coins have the Boolean Magnet on them.

    it might bee also because your movement condition is triggering for each coin but then u block it on trigger once.

    here is an example coin-magnet with the code above in it. and i removed all the behavior dependencies you have in the code there is simpler on my capx less complicated.

    I updated the file added the powerup magnet on player pick also so its easier to understand how to apply to your case! :) if you have problems with your post "waiting for moderator" just edit it and re-post it again.

  • That is the (Trigger Once) that it doesn't go well with the Loops it always causes malfunctions that are too hard to debug sometimes impossible.

    if you remove the Trigger once it should work properly. If you gonna destroy the Coins straight away on collision with the player it shouldn't affect much

    Also, you don't need the Pick All event just by checking distance and by removing the trigger once it should all be working fine, I hope it helps,

    Keep up the good work mate your Game looks awesome

  • Thanks a lot for the help, i greatly appreciate it! :)

    tarek2 i removed the trigger once and it worked like a charm

    thanks for the example project!

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