Modified Scripts From The Video awesometuts.com/blog/support-mobile-screen-sizes-unity/?
@jasperallenendozo75273 жыл бұрын
After almost 2 years! I finally found this tip. I can't finish my thesis because of this issue. It really helps me. Thank you bro!
@fulgencejuniorlohore85411 ай бұрын
2024 and still relevant! Thanks for this nice tutorial!
@arv_is3 жыл бұрын
after a week of looking for toturials and literally watching the same 5 of them ( including this one ) it finally worked and I actually understand it now... it was a nasty surprise because after i created my first game I couldnt get it to look right on my phone.. thanks a bunch!
@ghauswood95942 жыл бұрын
Plz help me out a bit then if u have the time to cuz for me it ain't working at all
@nathangames15762 жыл бұрын
I know how you feel. Came across what I believe to be a similar issue. Have not yet tested to see if this will fix my issue but I'm hopeful!
@ghauswood95942 жыл бұрын
@@nathangames1576 same, I think I found the solution
@YungxSlavy2 жыл бұрын
To anybody who comes across this video in 2022, an alternative is just making the playable area of your game a 3:2 aspect ratio and filling the background for 16:9 and 4:3 ratios. This way, play is universal for all possible devices.
@ghauswood95942 жыл бұрын
can u plz tell how cuz What do u mean by background for 16:9 and 4:3, aren't they a bit different even though they equal the same
@ghauswood95942 жыл бұрын
@Mr Tanaka with the viewport code right? Yeah I think my problem is already solved but thx for telling
@AlexGorskov2 жыл бұрын
@Mr Tanaka Hello, could you please give more details? I have 100% same problem. It would be a massive life saver!!!
@AlexGorskov2 жыл бұрын
@@ghauswood9594 Hi! Could you please elaborate? It's my main problem that I wasn't been able to fix for more than 6 months. Thank you in advance!
@moaz43952 жыл бұрын
@Mr Tanaka does it work for moblie?
@simmzzzz2 жыл бұрын
almost fell for this... The interior space is reduced unfortunately. While the alignment may work around the edges, it's increasing the space from the middle... Great attempt though.
@sadiqabbaszade47894 жыл бұрын
10/10 one of the most irritating issues in game dev. İ am hoping to find nice solutions in the video.
@spd91902 жыл бұрын
Another way to do this (not promising it will work for a moving camera) is to make a Plane object then add the below code to the camera and set the Plane to the camera script. Make the plane the size of the mobile screen you're working on and the bounds.size can be changed based on what dimensions you are adjusting. I used it for my project and it keeps the screen size and game objects at the desired ratio for all devices in the simulator. public class AdjustCamera : MonoBehaviour { public MeshRenderer maze; void Start() { float orthoSize = maze.bounds.size.x + (maze.bounds.size.y); Camera.main.orthographicSize = orthoSize; } }
@qazisaad57133 ай бұрын
thankyou so much that was so easy and it worked
@astralstormgamestudios1259 Жыл бұрын
Love your excitement over those scripts! Thank you alot! Very needed! I have always had this issues.
@mahanziyari76363 жыл бұрын
finally a video that points to real game objects and not the UI with the scale option. nice work keep going
@awesometuts3 жыл бұрын
Glad you liked it
@delilh3253 жыл бұрын
You have to do the anchor thing for every object, that's actually a pain
@jt95643 жыл бұрын
Certain assets must have these type of scripts as default shorely, other wise it would be a nightmare
@yzbrian2 жыл бұрын
Exactly what I was thinking!
@alenlednik4 жыл бұрын
This is NOT a good solution. 6:27 There will be a smaller gap between top/bottom ball and middle ball, because if that gap should be like 3 tile size tall when your character is like 2.5 size, so on wider resolutions there will be gap smaller than 2.5 between top and middle ball and your character will not be able to move between those 2 balls. This script will manage your corners/borders but it will not scale objects correctly to fit any size screen. On even wider screen resolution those 2 right balls will touch each other and there will be no gap between them at all.
@alenlednik4 жыл бұрын
@@awesometuts Try this on Motorola Razr resoltion (2142 x 876) and i'm sure that right 2 balls will touch each other or even overlap an this will be a problem even on your game.
@Wonder_Verse_Tech3 жыл бұрын
you are right,, but where's the solution, please help
@simmzzzz2 жыл бұрын
exactly, the only solution is to stretch the images. There simply isn't a way to fit all resolutions without stretching.
@agent-333 жыл бұрын
What about the object sizes? If they keep the original size, then the spaces of content will be smaller.
@hiddehi59822 жыл бұрын
exactly, i am having this proble right now.
@Wourly Жыл бұрын
Sounds scary..
@septercat Жыл бұрын
You can just select "Stretch" on them so it keeps getting bigger or smaller depending on the situation.
@septercat Жыл бұрын
@@Wourly You can just select "Stretch" on them so it keeps getting bigger or smaller depending on the situation.
@hologrammaster2468 Жыл бұрын
@@septercat Where is the stretch option?
@AnAngelineer3 жыл бұрын
But what happens when you move your objects? Or when the camera moves? Will the "anchored" items move with it, appearing immobile?
@bluebukkitdev80692 жыл бұрын
The object could move, but if you move the camera then the object will not since it is anchored to the camera.
@niranjanwagh57673 жыл бұрын
What to do if we don't want to anchor it but scale it with screen size ?
@shortyrip62838 ай бұрын
Got any answer?
@debasishnath675111 ай бұрын
Hello, its a great tutorial. please give some information on these two points: 1. the step by step recommend settings for a game to be deployed irrespective of the platform & the device screen size i.e. it can be run on either tab/phone/laptop. 2.How to deploy a task in android needing input from a joystick to move the character? it will be really helpful.
@ARTHUR145233 жыл бұрын
Thanks a lot. I was searching all the internet and couldn't find anything. I will try it tomorrow 😁
@jacobdesousa2 жыл бұрын
Solid 🔥Thank you
@vanpariyadeep2084 Жыл бұрын
thanks bro helped a lot.
@flacuchentxox31293 жыл бұрын
you can already do that by changing the rect transform on the inspector
@revendisio Жыл бұрын
Looks like a rather poor and half baked solution for responsible design. As other comments already said, game objects do not get resized. So if you design your game on let's say 4k and then use the script to turn everything down to 720p or whatever, you will end up with extremely large game objects. Also this way you have to anchor all game objects in order to have the correct scaling. And position game object somewhere else than the premade positions lead to the same problem you try to solve.
@coentertainer6 ай бұрын
Yeah this seems like an absolutely ludicrous solution. Do you know of a better way to handle different shaped screens?
@FidaHussain-nx7ql2 ай бұрын
what if we have a game where camera moves with the player ?
@pudgepudge15483 жыл бұрын
Where is your modified scripted located? I've signed up and I cant seem to find it anywhere
@Genericcc3 жыл бұрын
You can download it, I got scared seeing your comment but when I tried, I got access to the modified files, all you have to do is to click on view your course and search through the list for this video title
@bimodirty3 жыл бұрын
so do i, been searching anywhere in the website
@Genericcc3 жыл бұрын
@@bimodirty nah bro its right there, send me a dm on discord if u want more help
@anthoniuskosasih3 жыл бұрын
@@Genericcc the enrollment for youtube tutorial courses is closed now :(
@anthoniuskosasih3 жыл бұрын
@@Genericcc thank you so much for your help, for those in needs can contact Generic#6969 in Discord!
@Aye_Sid2 жыл бұрын
Thanks for the video. God bless u. 😇🙏🏻
@enjoylearning85853 жыл бұрын
Can stay long hours listening and watching.
@AmazinglyStrangeMedia2 жыл бұрын
Great video! Thanks for the info!
@SpencerJamesSucks3 жыл бұрын
This is exactly what I need, but is there a way to apply this on a canvas in unity? My entire game is built on a canvas.
@arashaz45772 жыл бұрын
Thank you Fahir ,it was always good to see your teaching but i got a question! should i do that anchor thing for every single gameObject in the scene??
@pacocu98393 жыл бұрын
Thanks, i couldn't find a way to do this, it was exactly what i was looking for
@cheery-hex2 жыл бұрын
thank you this works! only thing is now objects with waypoints don't go to the points, but instead go to the camera. I assume this is to do with camera viewport. Anyone??
@ejminissayan48222 жыл бұрын
what about perspective cameras. this code works fine on orthographic camera but not on perspective cameras.
@RickardApps Жыл бұрын
Do you have an answer for this?
@sspgames-studio72518 ай бұрын
I think scaling in unity engine should be simplier and not so complicated, i still have problems with scaling and resolituons even doing unity for years..
@orrun4 жыл бұрын
what did you modify in those scripts? What's the difference between yours and the original ones?
@NikCification3 жыл бұрын
This script only seems to work in "Landscape" mode... When I put the Camera Script into "portrait", the assets do not get scaled up or down :(
@Oudipus3 жыл бұрын
Really?
@chillinggamer64792 жыл бұрын
Yeah, even me too the portrait mode doesn't seem to work
@Excess-qn7qh2 жыл бұрын
u make my day !!! thank you !!
@TahaSalah2 жыл бұрын
thank you very much for this video and scripts.
@alain-roger3 жыл бұрын
What is the difference with Canvas UI component ? What are the pros/cons of both techniques ? These 2 scripts "push" to the center of screen all elements/sprites. But they do not resize elements/sprites according to screen size.
@SQWEKERZ2 жыл бұрын
Canvas UI scaling only works on Canvas elements, if your game only runs on the Canvas layer that will probably work but if that's not the case your UI elements will stay where they are supposed to be but everything else will shift. Can't say for the rest.
@atgamingstudios64454 жыл бұрын
What is up guys fire here 🤣
@davidandrade8023 жыл бұрын
How can i get download Modified Scripts? I didn't find it on the site.
@Wonder_Verse_Tech3 жыл бұрын
Did you get the script? Please help
9 ай бұрын
Really nice code!! I just put another camera and put culling mask to nothing, because i wanted to do this in a perspective camera, but didn't work, so this camera is orthographic an works as well.
@isox28163 жыл бұрын
This video so usefull.Thank you.
@idkkkkk65004 жыл бұрын
Love your vids bud
@panendraommina34744 жыл бұрын
i cannot rename camerafit to view port handler . by the way where is second script . the both scripts are similar
@Aaliya7102 жыл бұрын
Tysm :) you really helpd me alot :)
@eyonminer68824 жыл бұрын
Literally perfect timing
@m.g.electronic37074 жыл бұрын
Just wrote my review about the game. It is very good one, love it. Hope to bring you some revenue.
@tanvirsiddiqui59523 жыл бұрын
Cannot find the modified Scripts, please help...
@Wonder_Verse_Tech3 жыл бұрын
bro, You got the script or not? Please help
@Genericcc3 жыл бұрын
It was a little bit tedious to find the modified scripts, but except for that 10/10
@tanvirsiddiqui59523 жыл бұрын
Can you please help me getting the scripts
@Genericcc3 жыл бұрын
@@tanvirsiddiqui5952 sure, add me on Discord - Generic#6969
@isseyed3 жыл бұрын
Can you please help me getting the scripts ???
@Genericcc3 жыл бұрын
@@isseyed sure you got any socials?
@Genericcc3 жыл бұрын
@@isseyed no problem with mail,
@FaizKhan-pi7ds2 жыл бұрын
Great Video Straight to the point
@arpitsrivstva Жыл бұрын
*Make something to scale the gameObject accordingly, as well.*
@darox35493 жыл бұрын
How does it effect the Position of the effect? Will the coordinates be changed?
@usamaakram-sb8ex Жыл бұрын
I face a problem when I build setting On Android the terrain has been removed in the mobile view only shows a white surface and shows the player and UI Button
@donyxcalliber91574 жыл бұрын
Great help, Looking for the Right Solution for Decades
@xxxxx4092 жыл бұрын
so im supposed to anchor every single game object in order to scale my game ????
@amnon87134 жыл бұрын
in the AnchorGameObject script i have error in "CameraFit", what i need to do?
@panendraommina34744 жыл бұрын
iam also struggling on that thing what you want to do is at the starting lines of the script you see a link . copy and paste in chrome . and you see the code . 1.copy the code 2. create a new file named "viewportHandler" 3.remove the code after you opening the script and paste the copied code here but there is one thing . Fahir posted the two links which are similar to each other
@survivalizeed3 жыл бұрын
It is trying to reference to the viewport script. You need to replace CameraFit with the name of the other .cs file he linked in the Descripton
@astralstormgamestudios1259 Жыл бұрын
I guess it works also on UI ? maybe its ment for UI :P Is it the modified ones or ?
@qazisaad57133 ай бұрын
Guys i saw a thousand videos, i asked Ai tools and everything but all of this is bullshit, now lemme tell u ITS SUPERRR SIMPLE how i figured it out. So the thing is that unity follows the values in inspector, it doesnt follows the initial values in the script. So IN UR INSPECTOR, in ur canvas screenspace -overlay OR canvas - screen space camera, first set to scale with screen size, then u just have to set the reference resolution to what u want and screen match mode to match width or height and Match accordingly 0 to 1. Thats it, that reference resolution will already be then set to whatever screen u play the game on when exported. For example i set my reference resolution to 770x570 in inspector, now that i've exported the game i can play the game on 1920x1080 without having the game objects/ui elements change or go out of screen, they appear with perfect size and adjust appropriately.
@AlexAlex107033 жыл бұрын
so you have to add a script to every object in your game?
@awesometuts3 жыл бұрын
basically yeah, but this is not a solution for games that have too many objects, I have a better solution, I will create a video for that.
@AlexAlex107033 жыл бұрын
@@awesometutsOkay. i'll hit the bell.
@saibalaji47134 жыл бұрын
Can u make a tutorial on how to make mobile game character controls using unreal engine C++ I can’t find any tutorial on mobile game touch input for unreal c++
@awesomestuff72614 жыл бұрын
Very nice Fahir. Much appreciated.
@imperator01832 жыл бұрын
bro this process affect to game optimization?
@imanonymous026 ай бұрын
Thanks dude!
@karolledzinski7102 жыл бұрын
This is too much pain in a ass. I would say f.... those who got different screens.... Create your games with the margin and that's it!
@cursedcode51623 жыл бұрын
Great vid this helped a lot
@taruku_luca7 ай бұрын
the download link is just redirecting to the youtube video of yours
@sharp56243 жыл бұрын
sooooo, i need to add that script to every single object and move it again to the same spot ?
@hyukioshiygames28733 жыл бұрын
For some reason, this doesn't work for me :(( attaching the anchor script doesn't do anything..
@sandortoth52693 жыл бұрын
nice but in this manner on some devices the objects are going to be closer to each other compared to other devices.
@richardatordido13513 жыл бұрын
Can I use this in mirror?
@jt95643 жыл бұрын
Thankyou bro your a life saver A+++++++++++. the man
@awesometuts3 жыл бұрын
Glad I could help
@firedbl2c4923 ай бұрын
Thank you sir
@saurav59384 жыл бұрын
I think the thing you did with the AnchorGameObject script can be done with the Transform component itself. Correct me if I am wrong. @Awesome Tuts
@simmzzzz2 жыл бұрын
The RectTransform for UI has a built in ability to anchor to the edges, but not the standard Transform. Either way though, the solution doesn't work for scaling a game to any resolution. You can see that the objects get closer to the middle, which defeats the purpose...
@chrischichester66544 жыл бұрын
How do you know what unit size to input? I'm using 1920x1080 Portrait.
@Steve-gi2yj2 жыл бұрын
thank you for this, i am trying to use the script ScaleToFitScreen on my back ground and its not working, it keeps scaling the background my background very very small... like 0.0004 x and y is 0.0003... which is clearly not what i am testing, as when i use mobile deviecs, they need to be around 265 for x and y 216, but other devices need to be 300 etc... why is it not working???
@necatiakpnar56774 жыл бұрын
Thank you for this content bro :)
@dk33903 жыл бұрын
I tried alot but couldn't find your modified script
@mkkovacs11 ай бұрын
a god walks amongst us
@IlijaLuzheckij10 ай бұрын
Is this working for 2d?
@Entikai4 жыл бұрын
Thanks for the script, looks good!
@dodger6082 жыл бұрын
Hi Thank you for your help. I have a problem. I added CameraViewPointHandler Script to my camera. I can see the things on it but nothing happens. Even if i change Units Size, nothing happens
@Chuck_Greene2 жыл бұрын
I am having the same issue, did you figure it out?
@crypto.mr.b3 жыл бұрын
YOu save my life :)
@Wonder_Verse_Tech3 жыл бұрын
I can't find his modified script, Please anyone help?
@christianalejandroflores85014 жыл бұрын
thanks for the tips i would make a try on this
@nichegames95904 жыл бұрын
Thanks for the scripts.
@Funnygamingclips3 жыл бұрын
Anchor game object is not useful, if your game object is moving to any new position, because the anchor script will stop it from moving.
@awesometuts3 жыл бұрын
if you paid attention to what I was saying in the video and if you saw the blog post you would have read and heard me saying that this is for static games where objects don't move, or dynamic games but for objects that don't move.
@andreasleonidou36204 жыл бұрын
Hello. Nice video! I am now trying to download the 'modified' assets and I visited your website. I got an email after that, but it didn't include any assets in it. Am I doing anything wrong?
@Wonder_Verse_Tech3 жыл бұрын
Did you get the script? please hep
@lastsipahi9 ай бұрын
A little warning upfront. Works ONLY IN ORTHOGRAPHIC CAMERA!!!!
@shubhamsharma00993 жыл бұрын
i cant find the scripts and i really need them. ???
@jummagamedeveloperbeginner65094 жыл бұрын
Where is 'CameraViewportHandler' script? I just saw the cameraAanchor. Can you give me the link to get both of those scripts? As I can't find camera handler script, I think I'm at wrong link. Don't know where to get that script. So I'm asking you that where the script is on.
@gamingattns78193 жыл бұрын
Will this work for unity Ui ?? For managing multiple landscape aspect ratios
@awesometuts3 жыл бұрын
unity UI has its own way of achieving this effect with anchors, so you don't need this for UI
@Oudipus3 жыл бұрын
I need to put the script to all my gameobject? Then they will all stay at the right place?
@awesometuts3 жыл бұрын
yep
@Regisseur124 жыл бұрын
Could you please do the same Tutorial for Unreal Engine? I dont how to do it there... :/
@delilh3253 жыл бұрын
Doesn't work with the UI
@wolfl44304 жыл бұрын
Hey brother can you make a vid on how to get 720p 1080p 4k for a game in ue4 from the coding and artistic point of view , would be really helpful
@sepehrgoodman39884 жыл бұрын
Dear Fahir , Please create a video about cinemachine , im working on a ThirdPerson Game , everything is ok but i dont know how to move camera by touch control instead of move camera by Mouse X Or Y, im want to publish this game for mobile !
@sdglsle3 жыл бұрын
it still work ? i
@badbanana98944 жыл бұрын
So is this only applicable to static 2d camera? I'm slightly confused as to why this is happening on your game in the first place I have made a game and this does not happen The only thing I needed to scale correctly through resolutions was gui The game itself always renders correctly.
@badbanana98944 жыл бұрын
@@awesometuts ok thanks So it applies to objects rendered based on resolution. It confused me because I'm using gui on 3d moving games Thanks awesome dude.
@badbanana98944 жыл бұрын
@@awesometuts thanks again awesome dude.
@PeterPheneX4 жыл бұрын
Why it's so difficult to get the Scritp from your WebSite???
@PeterPheneX4 жыл бұрын
@@awesometuts Thank you. I Got it
@1onus2 жыл бұрын
hello, is this also applicable to 3d mobile game?
@awesometuts2 жыл бұрын
Yes
@magikalo3 жыл бұрын
nothing is working for me ... but still a good video gj.