Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
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
How could I make my character with platform behavior only collide with objects/enemies on the same layer? I have quite a lot of different objects that need to be on multiple layers and I'm looking for an efficient/elegant way to solve this without making tons of events for all the different objects. I think it might be easier to disable collisions on the character itself as needed (rather than try to manipulate everything else), but if anyone has any other ideas or has tackled similar problem before I'd love to hear your thoughts on this. Thanks a lot in advance, any help is appreciated!
For collisions with enemies you can add the "Is On Layer" condition in your collision events to filter out objects on other layers.
Unless you talk about solids, which is a different beast and might be better treated by grouping them into a family.
Develop games in your browser. Powerful, performant & highly capable.
on your collision event add additional condition:
system compare player.layernumber=object.layernumber
Now the player should only interact with the object if the layer number is the same
Thanks for the replies, unfortunately my game uses solids heavily so I'm still trying to figure this out. I also use platform behavior for some enemies and if I disabled their collisions or disabled the solids they're moving on they'd just fall from layout. Can families be used to solve this somehow? Is there any example how this could be achieved/workaround?