I am trying to:
I'm trying to have perspective work properly in my 2D 2.5D game, which uses the bird's-eye view.
I have tried:
I've tried using the following scripts:
And here are the details to each one (You don't have to read them):
The first one only works for the first instance of the tilemap 'house'; it doesn't work at all for the rest in the layout; when the player is in front of the house, it's actually behind it.
The second makes use of two parts of the same tilemap, the front and the back, which the front is a container of the back (so both will be destroyed when either is) and the front is on a lower layer than the player's and the back is on a higher layer than the player's. However, I've encountered essentially the same problem, but with the player on top of the back despite even putting that on top of the layer.
The third has the front and back not in a container, and thus with them on the same layers, perspective works fine. It also uses a third sprite, called 'HouseConnect', so it would supposed to be that when the house front was destroyed, it would set an instance variable in 'HouseConnect' to true, which in turn would destroy the house's back if it was also overlapping it.
This works if one instance of 'HouseConnect' were connecting the two sides and it wern't a part of HouseFront's container. However, if there was more than one of such instance connecting all four houses, clicking one 'HouseFront' would destroy all HouseConnect's and HouseBack's, while having the latter although would do the same thing for having all four houses connected, clicking one HouseFront would destroy that and in fact HouseConnect, but not HouseBack.
I needed HouseConnect because I can't have a tilemap detect if it's overlapping another object, like I can with sprites.
This is likely a lack of knowledge of how instance picking works. I do know that if I, for example, used a condition to detect if one object was overlapping another, it would destroy that instance only, otherwise, the event would destroy them all.
Google search engine helped me none, and I don't trust this forum's either.
However, I've been dealing with this problem for at least a month now, and I'm not getting anywhere (with the exception of the next section) with it, so thanks for your help.
Bonus: Although having the house sides as sprites instead does, in fact, work for having the two destroy each other when the front is clicked and for perspective, regardless of layer, I find the process for getting rid of the background when snipping or taking screenshots of them tedious, and I'm not sure about tilemap editors, since one I've tried couldn't export my map (or any tilemap, for that matter) as an image, and I would have to do the same tedious process in that as well; perhaps there's a less tedious way. Besides, this problem assumes the house sides are tilemaps, so if you have a solution(s) to the main problem either way, please let me know; thanks.