0 Favourites

Any idea why objects change layers without being made to?

  • Hey guys, I have this weird problem which appeared suddenly. I have certain sprites changing layers with no good reason. Further more they tent to jump to a GUI layer which has no parallax and things become messy. The thing is, I have absolutely no idea why. Probably something to do with my Zorder logic, although its been in place for quite a while and only started doing this thing when I added more NPCs to the seen... . If someone can tell be a way to make certain sprites don't jump layers it would be great.

    Cheers!

  • You would possibly need to post your events so we can see what is happening

    Other ideas to investigate could be :-

    -are the objects spawning ...or are they existing objects?

    -are you using layer names or just default numbers...?

    If you run out of options you could place a loop that says....every tick -->place objects on layer

    but this would be by no means anywhere remotely near a perfect solution...its always far better to find the cause than treat a symptom

    also what z order logic are you using?..your custom logic or someone else's?

  • I've just built upon the Zorder default logic. The thing is these objects jump layers at random times, and have been spawned for a while before they do...like trees and stuff that lives on the level to begin with.... I'd love to post events but its a huge system and I don't even have guesses at where the issues is from, so it won't really be of any help. I'm wondering if there is something known to do that, that I ain't aware of...

  • all I can say without looking at your events is add a new loop at the end which manually places the objects on the right layer every tick...its a brute force method but it might do the job

    just make sure its at the end of the event sheet

    the last call so to speak

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Thanks mate, may end up doing that

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