I have big problem with bring to front and bring to back events.. I try to explain it:
Objects:
Player
Tree (active object)
Detector
player's shadow
Events
Blue detector is supposed to be invisible.
Shadow has 8 directions movement, player's position is always 0x,-40y from shadow.
If player's shadow collides with tree detector, it stops (shadow can't overlap detector)
And the main thing, where is the problem:
y of player shadow is bigger than y of tree=> bring tree to back
y of player shadow is smaller than y of tree=> bring tree to front
And so, player can go behind the tree and can be in front of it.
It works with ONE tree...
BUT if I add more of them, it will go crap.
I know where's the problem because event effects to every tree. But how to get it so it would effect only in one tree. One way is to add dozens of tree objects (like tree 1, tree 2, tree 3...) But I know it's not the best idea.
Any help?
Current Projects: The Artillerys 10% Forgotten Legends 8% Earth Defender 20%
Try changing the "subject" of the event to the tree instead of the player - i.e. if Tree's Y position is greater than that of Player Shadow, bring it to the front, rather than the other way round. If that doesn't work, spreading values would be the way to go.