How do I change z layer?

0 favourites
  • 8 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • I have a body and an arm. i want the right arm to be below the torso when the torso faces left. above while facing right.

    i have a test where i press a button to change its zlayer, does nothing

    on left button clicked.

    arm z elevation=0. arm z=1

    arm z =1 arm z=0

    nothing. test text says it stays at 0

    the arm is a child of the torso. if that changes anything

  • This sounds like a common problem where it sets to 1 and in the same tick the next condition becomes true so it sets it back to 0 all in the same click. Add an 'Else' to the second condition and it should fix it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • super that did it

    but... i dont think zelevation is what i thought it was... its enlarging the arm (i set zelevation to 50 to be sure) and moving it left

    i just wanted its layer to be above or below the torso

    set it down to +1z elevation. nope, just moves up by x+1 y+1

    i could have 3 layers globally, and just move it above or below.. not sure if that will effect on collision

  • You probably mean Z order which is to move it above or below but on a given layer.

  • Yes.. that's exactly what I mean, and want.. but

    I have 5 options in z order.

    Move to bottom, Move to top. Move to layer move to object. And set z elevation.

    Elevation just squews the arm. Like its attempting it on a 3d axis.

    I swear this was easy in construct 2

  • Move to top or bottom should work as it will always move above or below the other object.

  • got it cheers. i swear half the time im just burnt out... and a little drunk... next morning i start and fix it.

    the whole else issue was problematic for this. i just set its layer based on the angle

  • Move to object is probably the most sensible choice, it lets you specify if you want the arm to be "in front" or "behind" the object. If you just set top/bottom it will work until you have other objects where the character goes behind or in front and the arm will end up at the top/below of ALL objects on the same layer.

    And yes, Z-Elevation is similar but does so within a 3D Space, which is why the arm gets larger or smaller.

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