Any idea why objects change layers without being made to?

Get help using Construct 2

Post » Sun Nov 27, 2016 9:15 pm

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!
B
18
S
3
Posts: 65
Reputation: 994

Post » Sun Nov 27, 2016 9:50 pm

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 :geek: :)

also what z order logic are you using?..your custom logic or someone else's?
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Sun Nov 27, 2016 9:57 pm

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...
B
18
S
3
Posts: 65
Reputation: 994

Post » Sun Nov 27, 2016 10:03 pm

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
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Sun Nov 27, 2016 10:05 pm

Thanks mate, may end up doing that
B
18
S
3
Posts: 65
Reputation: 994


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 17 guests