Problems with z order

I HAVE PROBLEMS MOVING THE PLAYER BETWEEN OBJECTS AND WALLS. I THINK IT WILL BE A BIGGER PROBLEM WHEN THERE ARE ENEMIES ON THE SCREEN.:crazy_face:

ANY IDEA THANK YOU.:blush:
ACA THE PROJECT:
https://drive.google.com/file/d/1-SSXzxOSOMs--Mtk5Ed6S2mz0Orgd7Ex/view?usp=sharing



I would say you need to check the position of the feet (add a point to the object) compared to the floor corner position of the box (add a point), and adjust the Z-order of one of the two objects.

2 Likes

APPLY A SIMILAR METHOD AND IT WORKS. I DO NOT KNOW IF IT IS A GOOD METHOD OR IF IT CAN BE SIMPLIFIED.
AM I SATURATING THE ENGINE OF UNNECESSARY OBJECTS?:thinking:
thanks for your help. :blush:
VERCION 2.0:
https://drive.google.com/file/d/1Psn4U971hcFlMsFufzmBaCXR7-QJHWqv/view?usp=sharing



I have a half-baked idea:
Create a group “blocking” and add all objects to that group that might block the view of the player.
Then add a new “Ray Cast” condition like this:
Check collision with “blocking” objects
Starts at X,Y of the player’s feet
Max distance is player’s height
The corresponding action for this Ray Cast should set the player’s Z-Order to match the “blocking” object that the ray cast collided with’s (Z-Order - 1)

Well… it’s just an idea… but I think it could work well.

1 Like

I have not practiced with groups of objects and instances of the same object. But I get the idea about the “ray cast”. I’ll try to test myself with this.
Thanks for the help. :smile:

I just realize I forgot to mention the ray angle should probably be straight down (or 90 degrees) to find the blocking objects.

1 Like