Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I want to compare 2 object position on layer (higher/lower) both for the same layer or different ones. Is there a way? Thanks!
Well for each object you have the functions "Is on layer" and "Pick top/bottom".
If you know that layer A is higher than layer B you can compare the position based on that. But I don't know if this will help on what you want to do.
So Pick top/bottom also cpmpares between 2 objects position on the same layer, doesn't it only pick the top/bottom object of a layer? In that case, it solves the problem for me!
Develop games in your browser. Powerful, performant & highly capable.
Actually, it doesnt, i have 2 object: leaf and stone. I want leaf to do not move if stone is, within the same layer, higher than leaf, so i need a way to compare that.
You might have to assign an instance variable on leaf and stone and track it manually.
instance variable zLayer (Number)
0 through [whatever]
Then assign the zLayer var manually, and do a check:
leaf.zLayer >? stone.zLayer