Array.CurX/Y keeps returning 0 in For Each Element loop

0 favourites
  • 5 posts
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • hiya! Everything else in the following code is working as intended but for some reason my resources keep spawning at tilemap coordinates 0,0 which makes me think that CurX and CurY aren't working as intended. I've even split them off into variables so that they aren't nested, hence "ResourceSpawnX" and Y

    Any ideas?

  • The wait is redundant and probably breaks it too, remove that and see if it's fixed

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The Wait was an attempt at a fix. Does loopindex not have any effect in for each element loops?

    When I take out the wait action, nothing spawns!

  • ah veto the nothing spawning comment, that was an unrelated issue. Taking out the wait has just had no effect

  • The loopindex has no effect and would probably break the loop. Take that out first. Then if nothing is spawning you can debug with Browser object and 'log', you can see what value in the array it finds. You don't have any handling for if it can't find the parameter string. We also don't see how you call the function. Do some logging and work it out. If it's spawning at 0 it might not be able to find anything, you have a lot of conditions that if just one isn't true then nothing will happen, it's down to you to put some logging in and try and find the exact place it goes wrong then you can work out why.

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