Some help with the Z layer

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • This:

    This only effects the first instance of "Chest". I don't quite know what I'm looking for here. I'd imagine you'd use "For Each" for something, but that doesn't work either. I most likely just really really stupid.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't see your image, but I assume that you are facing problem with Z-ordering. You can use For Each (ordered) and use object Y position as parameter. Here an example for that:

  • I can't see your image, but I assume that you are facing problem with Z-ordering. You can use For Each (ordered) and use object Y position as parameter. Here an example for that:

    Almost. But your example appears to only show how to fix my issue if it's only a single object. What I'm looking for is a way to make the player to go in front of or below (on the z layer) the chest depending of their placement on the y axis.

  • If you have multiple chests, then I think you need to pick the correct chest first, for example closest to the player or overlapping the player. Something like this:

    Chest Pick Nearest to (player.x, player.y)
      player.y<Chest.y      Player Move behind Chest
      player.y>Chest.y      Player Move in front Chest[/code:1drgypec]
    
    And, of course, both the player and the chest should be on the same layer.
  • Hi !

    Just do a "for each (ordered by Y)" loop including the player avatar and all objects you want to z-sort.

    Here's the online demo.

    For some weird reason I can't attach a .capx. But I uploaded one and you can download it by right-clicking the link below and saving link as...

    Yep! Just right-click me and choose Save link as...! It's that simple!

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