Hello everyone!
I´m creating a player-less 2D Point and Click game. I want the whole enviroment (being a room full of objects) to be interactive, so I need to work with Polygon Colliders 2D to create the hotspots exactly on top of the objects (thus I can´t just use simple Box Colliders 2D).
The Polygon Colliders 2D have been working just fine as hotspots in general, but now i encountered the situation of two hotspots seemingly interfering. Once there are two hotspots being Polygon Colliders 2D close together, the hotspots edges aren´t accurate anymore. If i delete one of the hotspots, the other ones´ edges are fine again.
I have a normal Box Collider 2D Hotspot to to test and it works just fine, edges are normal.
Here is a picture of how the hotspots are set up in the scene. I made sure that the edges are not overlapping because I thought that might be the problem, but it´s not. https://i.postimg.cc/s1ds0bKz/Folder-Armchair-Hotspots.png
When in game-mode the hotspots do work...
https://i.postimg.cc/tR16wPDv/Ingame-1.png
...but don´t match the edges. In the first picture you can clearly see, that the edges of the hotspots go all the way down around the armchair, but in game-mode the edge seems to be further up somehow.
https://i.postimg.cc/bYKnhJBy/Ingame-2.png
If I delete the Hotspot for the folder (Hotspot for the armchair is unchanged), the hotspot for the armchair seems to work fine again like in this picture. Same goes if I delete the hotspot for the armchair but leave the folder´s.
https://i.postimg.cc/MKVQKSCy/Ingame-3.png
All Hotspots are on the Default Layer and are marked as Trigger in the Inspector.
Hope you can help (:
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @Plina.
Do both polygons have the same Z-position - i.e. the same distance from the camera?
What are your AC / Unity versions, and are you using any special/custom technique for setting up the camera?
If not, and this is occuring in the latest release, PM me your scene file (and your Managers, just in case) and I'll take a look on my end.
Do both polygons have the same Z-position - i.e. the same distance from the camera?
-> Yes, both polygons have the same z-position. Both set to 0. Tried to change one of them and see what it does, but problem is still there.
What are your AC / Unity versions, and are you using any special/custom technique for setting up the camera?
-> AC version is v1.82.2 and Unity is 6000.0.32f1
-> I am using the main camera that was there by default. Since I don´t have plans for using any camera movement in the game (it´s always at a fixed postition), I didn´t pay much attention to it...
I also noticed that sometimes, when I enter game-mode or switch between scenes in-game, the polygon´s edges are in the right place again and then after switching again, they´re not. It almost seems random...
Thanks for the details.
I'll need to see the files, in that case - PM me those mentioned above and I'll take a look.