Closed maccxs closed 4 years ago
Some NPCs seem to be able to sneak out of the colliders and are then trapped at the top of the map between the collider and the Top:
In the above picture, the player is not able to move up due to the barrier and the NPCs at the top (higher than the player) are not able to move down.
There is an additional barrier, quasi along Hohe Straße that permits the player from moving to the right:
In this pic, the player is not able to move further right. However, when the player spawns to the right of Hohe Straße it can move in between Hohe Straße and the right barrier, but not to the left of Hohe Straße.
These were tested on Windows 10 with Firefox.
@holke Yes, indeed there was a collider which should not be there. Missed it somehow during my final test. Please try again and give me feedback.
When i start the game in non-fullscreen this works nice now. I can switch to fullscreen and the edge colliders are at the same place as in non-fullscreen (as intended, so switching to fullscreen does not increase the space in which i can move).
However, when i start the game in fullscreen or restart the game in fullscreen (after starting in non-fullscreen), the colliders do not work and i can move up to the boundary.
Circumvent removed colliders
So there is actually three things I did. Would be great if you could test in firefox which still does not work for me.
Moved the AddCollider to the start script. Not actually sure this makes a difference. Had to adapt CreatePopulation because then a reference was missing.
Added an actual Edge Collider in the editor so one will always be present.
Made a check in Update: if screen changes, the collider points are adopted.
These edge colliders are linked to the viewport only and change if we adapt the screen size.
I tried a web build which works. Looks perfect in Microsoft Edge and in Firefox the colliders are placed 1.5cm more inside the map at the left and right
I could also provide a solution for a moving camera, but I think we should discuss this first. Even here, the problem will remain that we have edges which the camera / smileys is now allowed to pass