Since the Auto Letterbox asset is no longer available on the asset store, I have created a free replacement asset. You can get it from here: github.com/rabidgremlin/LetterBoxer
@MRosen6134 жыл бұрын
Thanks, but how do i Install those files into my Unity game?
@Rabidgremlin4 жыл бұрын
Download the latest .unitypackage file from github.com/rabidgremlin/LetterBoxer/releases (currently LetterBoxer-1.0.0.unitypackage). Then inside Unity, select Assets > Import Package > Custom Package and then choose the .unitypackage file you downloaded (see docs.unity3d.com/Manual/AssetPackagesImport.html ). Once you have installed the package see the .pdf in the LetterBoxer/Documentation folder in your project for instructions on how to setup the component.
@MRosen6134 жыл бұрын
@@Rabidgremlin kk thanks
@ananasior4 жыл бұрын
Holy shit, i am doing a little project for my school with a shitton of maps, which of course need a perfect fit for the screen. I was so worried about the resolution issue, i hope that with this tool i will be able to fit my app to all students screens without problems.
@revengerwizard4 жыл бұрын
Hi, does this work also with a pixel perfect camera?
@Shack5 жыл бұрын
Really appreciate that you went through the errors and how to fix them!
@ozgurgurbuz2 жыл бұрын
I've had been suffering to apply same game view for every possible screen but I ended up finding this tutorial. It does not exactly cover the whole screen as I wanted, but this could work too. So, highly appreciated it, thank you. 💯
@sumitcutevil92602 жыл бұрын
did yu find anything that covers the whole screen?
@ozgurgurbuz2 жыл бұрын
@@sumitcutevil9260 Nope
@michajadczak43723 жыл бұрын
Thank you so much! I found my answer at 1:04 when you mentioned preserving, so all I had to do was shift "match" to 0 on my Canvas Scaler. I still watched it whole, and found that you proposed an even better solution for my game. That's great
@brandonservice97142 жыл бұрын
This works super well and its really easy, surprised how perfect this worked in 2022
@realmorteza8022 жыл бұрын
I really, really, really appreciate it. I tried many ways among them, only this way worked. thank you!
@pyrouan8905 Жыл бұрын
Even so much late, I want to express my gratitude for the ones who created this video and this asset
@Rabidgremlin Жыл бұрын
No worries!
@VajraG5 ай бұрын
Thanks sir I was trying to find this for about an hr thankfully I got that after watching almost 27 videos
@khantanvirahmed7505 жыл бұрын
Actually..the asset was updated recently..so it works just fine in unity 2019 without any editing.
@inxendere3 жыл бұрын
based
@koki10190 Жыл бұрын
Couldn't even find a thing about this when googling and you saved me :P
@ulasonat50424 жыл бұрын
I'm so grateful for this man! Thanks a lot, know you're loved! :)
@wescube-ligma Жыл бұрын
OMFG YOU JUST SOLVED MY LIFE WORRIES THANK YOU SO MUCH , I WAS SHORTLY BEFORE SCRAPPING MY ENTIRE PROJECT BCS OF THIS
@dedbrid3 жыл бұрын
I really, reallyyyyyy appreciate it! You literally saved my game! Thank you so much! 🙏
@JkNiikko4 жыл бұрын
Thanks a lot. I even considered remaking the entire project. 2021 and this video is still relevant.
@loganh67482 жыл бұрын
i feel that. I almost excluded the samsung galaxy fold Z from my game's compatible devices bc the ridiculous aspect ratio for that phone was breaking my game. Good thing i found this video!
@gael57456 жыл бұрын
thank you very much, you saved my life, I was already tired of the interface of my game being dislodged because of the change of aspect ratio
@LoganoutGm4 жыл бұрын
Thank you very much, I had tried many things and you were special in releasing this script. It sure helps a lot of people, congratulations!
@MrXGames5 жыл бұрын
Thanks for the upload, been putting this off on my 9x16 2d game, very helpful for 9x18 deployment. I don't see how this kind of functionality is not baked into Unity and practically every vid about aspect ratios is for UI scaling, not the actual game itself. Still gonna try to scale it up to 9x18 without bars, but, this is a great fall-back.
@ARTHUR145234 жыл бұрын
Did you manage to do it without the black bars?
@MrXGames4 жыл бұрын
@@ARTHUR14523 I did not. It got too wonky - preferred the bars. Lesson learned though to design the worldspace for the largest dimensions but have all the action occur in the 9x16 play area.
@loganh67482 жыл бұрын
@@MrXGames cheers to that brother
@peterroth5287 Жыл бұрын
@@MrXGames Thanks for relaying your lessons learned
@dogukan6604 жыл бұрын
Dude I've been trying to solve this problem for days. Thank you so much I was going crazy.
@Michael-The-Composer6 жыл бұрын
Nice informative vid, very clear and you make it all so easy to understand! Thanks! You earned a new sub! :)
@Quizfox6 жыл бұрын
Thanks. I was getting annoyed at the game not scaling with the window and this helps a lot.
@skyblueink6 жыл бұрын
Wow, thanks! It works great, and thank you for showing how to fix the warnings and errors.
@bobmcbob43992 жыл бұрын
But you see the problem at 4:13 is that your round mouse controlled target reticle asset now disappears into the letterbox bars instead of being constrained to the new reduced vertical space enforced by the new code. How to fix that one?
@sjoerdev5 жыл бұрын
thank you do much, been struggling with this for a while now
@junaidarshad2k6 жыл бұрын
Saved me a lot of hassle! Thanks for this video!
@Anton-tb9je5 жыл бұрын
tank you very much this is exactly what i have been looking for over the Last days
@ivanpejovic4 жыл бұрын
Thanks man, this really helped out a lot
@Rabidgremlin4 жыл бұрын
Glad to hear it!
@irontim19764 жыл бұрын
@@Rabidgremlin saved my life buddy appreciate it
@AdrenResi6 жыл бұрын
For a long time, I was struggling to figure out what was going wrong with my project since basically nobody was getting the same problem I was having! For this template to work, the camera must be set to "World Space" instead of "Screen Space - Overlay" or "Screen Space - Camera". Of course, that means you'll have to reposition the screen, but that shouldn't take too long to fix.
@Rabidgremlin4 жыл бұрын
Unfortunately, the Auto Letterbox asset is no longer in the store. I'm looking into creating a new one. In the mean time see this gamedesigntheory.blogspot.com/2010/09/controlling-aspect-ratio-in-unity.html for some code you may be able to use.
@Rabidgremlin4 жыл бұрын
Unfortunately I do not.
@敲键盘的猫4 жыл бұрын
@IDK Can you share the link to me? Thanks a lot!
@cH3rs4 жыл бұрын
linked code works like a charm
@gustavosancho59144 жыл бұрын
You can achieve a similar result using the method in the link in combination with the "Aspect Ratio Fitter" component
@sydneyidundun78984 жыл бұрын
@@gustavosancho5914 could you elaborate on this
@KyoKurosagi5 жыл бұрын
Thanks. But i use another method. Much more simple. Just select on "Main Camera". Under Inspector "Camera" section, tick on "Physical Camera". Then change the "Field of View" to focus on your needed view. This will fix the camera view no matter what is your ratio or screen size.
@mehmetrdvanyldrm92684 жыл бұрын
How do you do that in 2D?
@YoutubeChannel-oq6ss5 жыл бұрын
What if you do not want the black bars? Like how do mobile games on google play get the game to fit to all mobile screen sizes without having black bars?
@alextashkov27724 жыл бұрын
Works perfectly. Thank you!
@Layarion4 жыл бұрын
Why use this over the Canvas Screen Size option with a 0.50 width and height slider bar thing?
@crackedcrackeroncracktheii4209 Жыл бұрын
does this only work with 2D games or does it also add black bars and fix the Resolution not 3D games?
@eduardwilson5473 жыл бұрын
Thank you so much!
@sids31944 жыл бұрын
any workaround? the asset is no longer present in the asset store due to it being deprecated .
@Rabidgremlin4 жыл бұрын
Yes the asset is unfortunately no longer in the store :( I'm looking into creating a new one. In the mean time see this gamedesigntheory.blogspot.com/2010/09/controlling-aspect-ratio-in-unity.html for some code you may be able to use.
@leducia6 жыл бұрын
Perfect! Thanks :)
@ARTHUR145234 жыл бұрын
Thanks very much. But is there any solution to strech or minimise the game without the black bars?
@xot98974 жыл бұрын
how do you do this in unity 2019
@theMagos6 жыл бұрын
Works nice, but it doesn't affect the UI (the UI will overlap the letterbox). Can this be achieved?
@gergedang9286 жыл бұрын
Set canvas render mode to Screen Space - Camera
@lordciciu6 жыл бұрын
Sorry, but when i make an app for android the resolution changes with black borders too, if yes how can i remove them?
@sydneydoc7 жыл бұрын
Any plans for adding UI control?
@joelkanna35632 жыл бұрын
Same question.
@dogeamazedo8835 жыл бұрын
Clear and very neat
@jahmaijones63316 жыл бұрын
you lifesaver!!!
@DarioCorno5 жыл бұрын
Hi and thanks for your video. I was already using the auto letterbox script, but I keep having a problem. I'm using an ortho camera for my game, and cannot in any way get a background instead of the solid color bars after using the plugin. The dragon sample inside auto letterbox seems to be working (by using a sprite linked to the main camera) but all my interactions are based on an orhto camera. Any help?
@shubhambairagi86984 жыл бұрын
its no longer available on the asset store.. can you please share it somehow.
@AniViRus4 жыл бұрын
check the pinned comment
@entreato6 жыл бұрын
Cool, but... this only affects while running it on Editor. I would like to find a solution for my builds aspect ratios.
@michaeldavis69934 жыл бұрын
Me too I have the same problem it has been a few days and I still can't fix it
@Alexander-dk8tb4 жыл бұрын
@@michaeldavis6993 Same here just emailed the person who made it, maybe a bug in the new version of unity?
@Alexander-dk8tb4 жыл бұрын
My issue turned out to be with the UI as the rest of the game scales fine on build. In the canvas object there is a "canvas scaler" component. I changed that to scale with screen size and changed it around till it worked.
@Bess2k26 жыл бұрын
great vid, TY
@Ascaron506 жыл бұрын
When I have a canvas it keeps adjusting itself on the Z axis when I change the aspect or resolution, why is that ?
@dusansimic19076 жыл бұрын
Great vid thanks a lot !
@gazark30684 жыл бұрын
Thank you!
@Bess2k25 жыл бұрын
God send
@carlosegat14594 жыл бұрын
Can you tweak it so the letter box appears only at the top?
@carlosegat14594 жыл бұрын
Cameras > ... > Anchor = Bottom
@구독자500명되면이같은5 жыл бұрын
is there any way to stretch the screen =[
@vuilachinhS6 жыл бұрын
Thank you very much!!! But It didn't working in ratio 10*16
@leokamikkaze207 жыл бұрын
is there any tweak or something else to make it work? I started a new project, imported the auto letterbox fresh new, set the desired aspect ratio and yet when I play, theres no letterbox and a deformed rendered image :/
@Rabidgremlin7 жыл бұрын
+leonardo ferreira did you make the code changes from the video and are you in a 2D project with an orthographic camera?
@ripscru80324 жыл бұрын
thanks bro
@bymsec5 жыл бұрын
thank you so muchhhhh broooooooooooo
@unknownuknown41953 жыл бұрын
Are this not working on 3D Games ?
@Rabidgremlin3 жыл бұрын
This is only for orthographic cameras which are mostly used for 2D games.
@hanni026786 жыл бұрын
What are your main camera settings ? My UI scales and leaves the screen on every setting :P other than the original. Great vid tho.
@hanni026786 жыл бұрын
Ooo I have figured it out :D, set your canvas on "scale with screen size", put in your resolution under the "reference resolution", change "screen match mode" to "expand" and the number under it doesn't do sh** :D lol. And it should be done :D.
@V1TOCHIN5 жыл бұрын
@@hanni02678 Dude I love you! seriously, Ive been struggling with that for so long. I had mine set to match width or height (0.5 like most tutorials tell you). anyway thanks man
@hanni026785 жыл бұрын
@@V1TOCHIN Glad it helped xD alto tbh I totally forgot about this comment.
@gbezjak Жыл бұрын
@@hanni02678 THANK YOU SO MUCH! YOU ARE A LIFE SAVER! I've been struggling with the UI scaling for way too much.
@alvaroerroz83656 жыл бұрын
Thanks, I having a problem and maybe you can help me. My player limits depending on the camera limits, if the aspect ratio has not to be framed it works perfectly. But with this solution, when its being framed the Player limits aren't good. Anyones knows why? Please heeeeeeelp :) private void PlayerLimits() { Camera _gameCamera = Camera.main; _xMinPlayerPos = _gameCamera.ViewportToWorldPoint(new Vector3(0f, 0, 0)).x + _padding; _xMaxPlayerPos = _gameCamera.ViewportToWorldPoint(new Vector3(1f, 0, 0)).x - _padding; } private void Movement() { var _newPosX = Mathf.Clamp(transform.position.x + _deltaX, _xMinPlayerPos, _xMaxPlayerPos); transform.position = new Vector2(_newPosX, transform.position.y); _anim.Move(_deltaX); }
@alvaroerroz83656 жыл бұрын
No one knows?
@inori51385 жыл бұрын
Am I Only Cant Do That ?
@bibbisbibbis7 жыл бұрын
Surely Unity has a built in way to do this..?
@Rabidgremlin7 жыл бұрын
No it does not. If you are doing 3D then the perspective based camera more or less handles this for you. Not so much for 2D.
@abeloftmusic19487 жыл бұрын
Hey! Nice video :) I have one major problem tho. I get this error: Letter Box Camera has a depth of -100 and may conflict with the Letter Box Camera in Forced Camera Ratio! UnityEngine.Debug:LogError(Object) LetterboxCamera.ForceCameraRatio:Start() (at Assets/Auto Letterbox/ForceCameraRatio.cs:187) I am kind of a rookie so any advice would be super valuable! Thank you so much for your anwser! :)
@Rabidgremlin7 жыл бұрын
You'll get that error if any other cameras in the scene have a Depth of -100. Check all the cameras in the scene. Generally you only need one (the Main Camera) and it should have a default depth of -1.
@abeloftmusic19487 жыл бұрын
Rabidgremlin My only camera has depth of -1. The reason why I'm asking this because our game has been on play store for a few weeks now and in our latest update the letterbox camera doesnt work anymore. I have no idea what to do and this is really frustrating. Our players are asking why it isn't working anymore and I would really need help.
@Rabidgremlin7 жыл бұрын
+Abeloft Music mmm, have you perhaps managed to create the component twice? Check through your hierarchy. When you run the scene in the editor check if multiple letterbox cameras are getting created.
@abeloftmusic19487 жыл бұрын
Rabidgremlin wow it really creates two of them :o what can I do to fix this?
@Rabidgremlin7 жыл бұрын
You will need to check all the objects in your hierarchy to see if you have managed to get the "Force Camera Ratio" script attached to more then one game object. Make sure there is only one such script attached to a game object in your scene.
@RavenFelman7 жыл бұрын
It will this works fine also on mobile devices?
@Rabidgremlin7 жыл бұрын
Yes it will.
@sebastianzogala81176 жыл бұрын
Thank you.
@kajinx18486 жыл бұрын
I love you
@Victor-cn1ku5 жыл бұрын
LifeSaver.....
@jeannoeldallaire26692 жыл бұрын
Great video, helped me tremendously
@Rabidgremlin2 жыл бұрын
Glad it helped!
@parasyte82302 жыл бұрын
Thank you!!!
@wasituzayer97286 жыл бұрын
Can't I resize all the game objects in such a way that it fits all screen sizes... Cause I"m having problems with the black boxes... I need help, so please... reply