Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed loading screen UI bug when aspect ratio is 21:9 or similar ultr… #529

Closed
wants to merge 1 commit into from

Conversation

sarahvdr
Copy link

@sarahvdr sarahvdr commented Apr 21, 2023

This PR addresses both issues #426 and #518.

For #426, I changed the colliders on problematic objects like slimes and small bushes from sphere colliders to box colliders. I downsized the box colliders to be slightly smaller than the actual object so as to make it as functionally close to a spherical collider as possible. This removes the possibility for the player to slide up the sphere's upper slope when moving too close to it. I also added some fail-safe code at the bottom of Protagonist.cs, where I check the distance between the player and bush/critter objects (identified by appropriate tags in Unity) to see if the objects are clipping (i.e. their colliders are overlapping), and lerping the player just outside of the object's collider if so.
For #518, I made a new script, UIScaling.cs, and attached it to the Canvas object which contains the loading screen. In this script, I gets the screen's width and height, and readjust the canvas size to reference this size and scale to it, so that it works for any resolution.

Here are two videos demonstrating the fix for #426, one where I try running up on, walking up on, and hitting bushes from different angles, and another where I do the same to a slime. In both videos and all my testing, I was unable to replicate the bug as before.
https://user-images.githubusercontent.com/73858910/233730332-5c8a69ab-3be9-48ea-9b59-b79478e1eeaf.mp4
https://user-images.githubusercontent.com/73858910/233730349-cf34f59a-d895-4802-b96f-00fd8ec89677.mp4

Here is a video demonstrating the fix for #518, where I load the loading screen in first 16:9 aspect ratio, then 21:9 aspect ratio, then 21:5 aspect ratio. For all ratios, the loading screen looked the same, demonstrating how it now scales properly for all kinds of displays.
https://user-images.githubusercontent.com/73858910/233730873-6759e569-04e2-4eb2-81ea-d0f3de290bcb.mp4

…a wide ratios, as well as the bug that causes the player to hop on the slime or bushes automatically
@CLAassistant
Copy link

CLAassistant commented Apr 21, 2023

CLA assistant check
All committers have signed the CLA.

@sarahvdr sarahvdr closed this by deleting the head repository Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants