GML Having trouble with depth to make a semi-3D illusion.

Dark Hydrak

Member
I am incredibly new to GameMaker, and coding alone. I currently have this project that I've made a lot of progress in, it's a 2D platformer and as of now, everything is working correctly. However I have updated the visuals slightly to have the ground tiles semi-3D cubes. I've got them to work correctly in terms of using depth=-x+y as the creation code for the tile. The player walks on top of it perfectly, but as you can see in this gif (a mod might have to approve the link since this is my first post) Gyazo Gif Link she will overlap the block on the left side. The grassy tile is the only object that is 3D as of now. If you need to know any more detail about how my game is working, I'll try to provide.

I am around my 5th day of GML knowledge so please go easy on my small brain, ty!
 

NightFrost

Member
Seems you'll need to cut the sprite and box in two, where one object is the front face, and the other is the top and right faces. On the front face sprite, set origin point low enough (outside the sprite borders) so it is always in front when player comes close enough. On the other piece set the origin high enough so it is always behind when player walks across. Collision boxes on both need to be set correctly to allow movement. The downside here is, now you need to use two pieces to build a single terrain block, and because of their adjusted origin points, they probably don't quickly align with the grid and need to be manually adjusted to correct positions.
 

Dark Hydrak

Member
Alright, me and my team decided to go full 2D because 2½D seems too complex for me at the moment. Thanks for telling me the best possible solution
 
Top