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.
ANY IDEA THANK YOU.
ACA THE PROJECT:
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.
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?
thanks for your help.
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.
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.
I just realize I forgot to mention the ray angle should probably be straight down (or 90 degrees) to find the blocking objects.