Fake layer order

imjustmikeimjustmike Member Posts: 450
edited January 2017 in Working with GS (Mac)

Hey, I know we can't change layer order during run time, but I was wondering if there was a way to fake it?

I'm working on a project where I want to create an effect that make actors look like they join together, I've attached a GIF below that uses hedges as an example:

image

I am constraining an actor that is taller above a movable actor to create the effect. As you can see, due to the layer order, it only works on one side (top or bottom) depending on the layer order. On the left it works from above but not from below, and on the right vice versa.

Ideally I'd like the movable hedge to 'know' what order it is in relation to others (likely by y position I imagine). Ideally this would be done through changing layer order, but since this isn't possible I was wondering if this was possible to fake another way?

I've seen the tshirtbooth solution but that won't work as it requires touch to be actively pressed and I want the effect to remain even if press isn't touched. Also, i the final project I'd want this effect to be applied to all actors, not just one as in the demo, just to make it harder ;)

Probably not possible but figured I'd ask you guys.

Comments

  • ArmellineArmelline Member, PRO Posts: 5,332

    More details on how it's going to be used please. What you want to do should be possible, but it's going to be one of those things where even a slightly wrong approach will be totally wasted effort.

  • imjustmikeimjustmike Member Posts: 450

    I'm going to create a puzzle game where the player can move different blocks around (in a grid). The blocks will all be the same size, and will be able to move up and down, left and right, in a straight line only.

    Pretty standard slider puzzle really. I just want the blocks to look like they blend together when next to each other. That's easy to do on a horizontal basis, but because I want there to be a shadow on the 'bottom' (fake perspective) it makes it harder to do vertically.

  • ArmellineArmelline Member, PRO Posts: 5,332

    Okay, sounds doable. Can you post the bush image, or another that would be usable to achieve the same effect?

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2017

    Here is one approach (attached), grab a bush and move into position.

  • imjustmikeimjustmike Member Posts: 450

    Hey, sorry for the delay in replying - work has been insanely busy the last week!

    @socks - that's a really interesting approach, I hadn't even thought of splitting the actors like that. I might keep on looking though, as I have 42 actors that will need the same treatment which might make it annoying to manage scene layouts. I'm also not sure what performance issues it might cause given that they'll be in a grid and thus might fire several dozen constrain behaviours at once due to collides.

    Figure a little more context might be useful - I'm trying to make a puzzle game with mazes, but instead of navigating a maze, you move hedge blocks around to create an escape route. So there'll be lots of movable blocks on screen at any one time. All the complication comes from me wanting to fake a 3d perspective. If it was top down I'd have finished it long ago!

    @Armelline I sure do have an image! It's below :)

    image

Sign In or Register to comment.