I dont mean to be so offtopic but does anyone know a trick to get back into an instagram account?? I was stupid forgot the password. I appreciate any tips you can give me.
@Axel Aldo i really appreciate your reply. I found the site on google and I'm in the hacking process now. Seems to take a while so I will reply here later with my results.
I'm pretty new to C# coding, super grateful that we have resources like this for free on the internet. It all seems so complicated but when you break it down logically like this it all makes sense Thanks Press Start
Thank you so much! You have no idea how long I've been looking for something like this! Even though this video is 4 years old at this point, it helped me a ton!
Thanks a lot! I struggled for a while trying to find something explaining how orthographic size relates to objects positioning! And your video explained everything perfectly! Couldn't do minimap for my game without it!
My god, THANK YOU! I've been trying to code something simillar and your video made me realise why Screen.width / Screen.height was giving me back the wrong values, I had to write it like this: *(float)* Screen.width / *(float)* Screen.height Thank you a lot for this video, that issue was driving me nuts.
I was very confused why this worked for everyone but me. Guess what... my script was not check marked so it was disabled all the time xD. Great video, i have a phone with a weird resolution so i needed this to be able to play my own game lmao
Thank you very much! Video and sound is awesome, speech is great and it is easy to understand you! Even I am from Russia I did it and it works, thanks again!
Hello, good tutorial but what if you are not using spriteRenderer but instead the game object? i created a plane out of the game object and i want to fit the camera to the game object x and y axis. I tried modifying your code where instead of the sprite renderer, i used the transform of the plane where it calculates the x axis and the z axis but still does not work. Do you have any idea for this?
Excellent explanation. I have been trying to figure out these kinds of things for a long time and you do a great job on your videos. Are you still making videos? It doesn't seem like you have anything for a while.
Wow I've been looking for a solution for this issue for weeks. I was using Cinemachine's TargetGroup Camera to replicate this behavior but the TargetGroup feature doesn't work with the PlayerMovement Claming that I'm using so this simple method saved me.
Great tutorial! After a long search finally a good explanation. Does the formula for calculating the orthographic size have a general mathematical reference or name?
Hi, thank you for the tutorial. But this doesn't work when the orthographics camera is rotated 90 on x-axis. Please help! ANd also please make tutorial for Perspective view as well!
Amazing video! After searching so many tutorials, this is finally the one that actually does what I want! Thank you! One question though: Now it scales based on the screen size only. But on devices like iPhone X that have the weird display with the cut out and round corners it's not really desired. Is there some way to make it scale not to screen size, but the safe area of the screen only?
Hello , Peter I think this is exactly what I'm looking for. I'm using cinemachine virtual camera on my game and I cant get it to work properly, here's my script attached to my main camera public SpriteRenderer screenAdapt; public CinemachineVirtualCamera CinemachineVirtualCamera; void Start() { float screenRatio = (float)Screen.width / (float)Screen.height; float targetRatio = screenAdapt.bounds.size.x / screenAdapt.bounds.size.y; CinemachineVirtualCamera.m_Lens.OrthographicSize = targetRatio; if (screenRatio >= targetRatio) { Camera.main.orthographicSize = screenAdapt.bounds.size.y / 2; } else { float differenceInSize = targetRatio / screenRatio; Camera.main.orthographicSize = screenAdapt.bounds.size.y / 2 * differenceInSize; } }
how do you fit both width and height of the playground edge to the screen size at same time. you have shown weight and height edge fit on screen edge . but how to you do at same time???
Unfortunately that's not how screen's work. It would be impossible to factor in all screen aspect ratios to have a screen fit both height and width of an object. You could instead alter your object to fit the width and height of the screen, but that's a whole different video.
Is there a way to make the view orthographic on one axis and perspective on another so if you move closer and further away, things would only get bigger/smaller on one axis? I’m talking about 3D not 2D games.
Very helpful. can we use same with canvas? i have problem when screen resolution changes my sprite images which are not part of canvas are get cut off.
Hey guys how do i set a start camera position, i'm making a 2d game and i want the camera to stay in the left border where start the game but if the user changes the resolution the camera goes further and swallow a little piece of the scene what should i do to fix this? How do i make the camera stay in the start left border without swallow in it?
I'm looking for how to have different screen aspects for different scenes. It seems of you have landscape on the menu scene it does that for all other scene..where I want portrait. How world I do this?
Hello Press Start, it is a nice Video, but useless for me because i dont have an Orthograpic camera. I have a Perspective Camera and the script dont work with this type of camera. So, do you want to make a whole new Video about the zooming from a Perspective cam? Would be nice!
I might make a more in-depth video down the road, but I covered this topic in one of the more recent videos. Here's the link: ruclips.net/video/4_HUlAFlxwU/видео.html
Great video, but as I implemented it in my game of pong for android, it gets cut off at 18:9 screen ratio... works with every other screen size or ratio
Copy & Paste Source Code: pressstart.vip/tutorials/2018/06/14/37/understanding-orthographic-size.html
for 9:19 Aspect Ratio, it is not working
Hi
What resolution of rink you had? My rink is cropping on top and bottom
My resolution is 1242x2208 (WxH)
I dont mean to be so offtopic but does anyone know a trick to get back into an instagram account??
I was stupid forgot the password. I appreciate any tips you can give me.
@Brayan Lucca instablaster ;)
@Axel Aldo i really appreciate your reply. I found the site on google and I'm in the hacking process now.
Seems to take a while so I will reply here later with my results.
Thank you, this is the first video that actually addresses the problem and most scenarios to do with aspect ratio
I'm pretty new to C# coding, super grateful that we have resources like this for free on the internet. It all seems so complicated but when you break it down logically like this it all makes sense
Thanks Press Start
That was by far the most efficient way to solve my problem with my first game.
That was the last part i was missing, thank you so much.
Fantastic! This is the best explanation I’ve seen so far. The examples help a lot.
Thank you for putting in the effort!
What is the rink?
@@fenix3752 RInk is the image/sprite he uses, which is a hockey field (ring/rink)
@@DracoGrim thanks man
Wow. This is the first video that actually explains this problem really well. I've been searching for an hour trying to solve this issue.
Thank you so much! You have no idea how long I've been looking for something like this! Even though this video is 4 years old at this point, it helped me a ton!
Thank you for explaining one of the major and common problem in such a simplistic manner
This is the best explanation I've found so far.. crazy it was made 4 years ago! Thanks a lot!
This and your edge collider hack video really helped solve a problem that had me stuck. Thank you!
You've helped me understand how camera sizes and screen resolutions work together. Thank you so much, great video short and concise!
Thanks a lot! I struggled for a while trying to find something explaining how orthographic size relates to objects positioning! And your video explained everything perfectly! Couldn't do minimap for my game without it!
My god, THANK YOU!
I've been trying to code something simillar and your video made me realise why Screen.width / Screen.height was giving me back the wrong values, I had to write it like this:
*(float)* Screen.width / *(float)* Screen.height
Thank you a lot for this video, that issue was driving me nuts.
Absolutely amazing. I have spent HOURS trying to figure this out. Thank you, thank you, thank you.
Exactly what I needed. Perfectly explained. Thanks!
Literally exactly what I needed, many thanks to you, friend!
Awesome, glad I could help :)
I was very confused why this worked for everyone but me. Guess what... my script was not check marked so it was disabled all the time xD. Great video, i have a phone with a weird resolution so i needed this to be able to play my own game lmao
I have to thank you very much for this simple and effective solution!
it worked great for me for my board game with both Phone and Tablet support!
this is exactly what i was searching for, for years. thank you!!!!!!!!!!!!!!!!!!!!!
TYSM!! This is exactly what I was looking for!!!
Thank you for explaining and example
Good Job! Nice explanations suited for beginners. Waiting for next videos, subscribed!
BTW, what is rink?)
Thanks, I haven't tried it yet but I'm sure it will work. You explained it very well.
Very well explained, thanks for the video.
Thank you very much! Video and sound is awesome, speech is great and it is easy to understand you! Even I am from Russia I did it and it works, thanks again!
Damn u are so so helpful, you are truly underrated
Hello, good tutorial but what if you are not using spriteRenderer but instead the game object? i created a plane out of the game object and i want to fit the camera to the game object x and y axis. I tried modifying your code where instead of the sprite renderer, i used the transform of the plane where it calculates the x axis and the z axis but still does not work. Do you have any idea for this?
Great tutorial man!
thanks man!
Thank you very much for this solution. It worked really well for me :)
This worked for me. Thanks!
It workeddddddd... I was looking for 1 month oooooloohohhohohohh...
How are you so calm? I'm struggling to keep my brain from revving to 12k rpm. Don't know what it's like to be normal anymore
Fantastic bro
Helped a lot
Thank you bro
Excellent explanation. I have been trying to figure out these kinds of things for a long time and you do a great job on your videos. Are you still making videos? It doesn't seem like you have anything for a while.
This was so useful! Thank you!
Thanks! U got my subscription!
Thanks! This was exactly what I was looking for!
What is the rink
@@fenix3752 What do you mean?
@@intrer8601 what is the rink thing he is using in the tut
@@fenix3752 Oh, I used it for my own project, I didn't use the rink thing in the tutorial.
@@intrer8601 than what did you used plz tell me help needed
Thank you for this Great Tutorial I really Liked it!!
This tutorial is
🔥
🔥
🔥
🔥
Thank you :)
Wow I've been looking for a solution for this issue for weeks. I was using Cinemachine's TargetGroup Camera to replicate this behavior but the TargetGroup feature doesn't work with the PlayerMovement Claming that I'm using so this simple method saved me.
Great tutorial! After a long search finally a good explanation. Does the formula for calculating the orthographic size have a general mathematical reference or name?
Good job, it helped a lot, thanks for posting ;)
Well explained 👌
Man, you are best!
You are a legend!
Thanks for the video, it helped a lot!
Glad I can help!
Thanks, it helped me a lot!
Brilliant dude
Great explanation :)
wonderful stuff!
thanks a lot.
have any idea how to do the Fit to Fill? so there will be no black borders from either portrait or landscape?
Thank you!
Great Work
Legend video
Hi, thank you for the tutorial.
But this doesn't work when the orthographics camera is rotated 90 on x-axis.
Please help! ANd also please make tutorial for Perspective view as well!
Amazing video! After searching so many tutorials, this is finally the one that actually does what I want! Thank you!
One question though:
Now it scales based on the screen size only. But on devices like iPhone X that have the weird display with the cut out and round corners it's not really desired. Is there some way to make it scale not to screen size, but the safe area of the screen only?
this video is a life saver tysm....
you're the best, excellent bro!!
thx u made it so ez now
Thanks, very helpful!!!
For virtual cameras, public CinemachineVirtualCamera CinemachineVirtualCamera;
public SpriteRenderer ScreenSizeSprite;
void Start()
{
float orthagraphicSize = ScreenSizeSprite.bounds.size.x *Screen.height / Screen.width *0.5f;
CinemachineVirtualCamera.m_Lens.OrthographicSize = orthagraphicSize;
}
Hello , Peter
I think this is exactly what I'm looking for. I'm using cinemachine virtual camera on my game and I cant get it to work properly, here's my script attached to my main camera
public SpriteRenderer screenAdapt;
public CinemachineVirtualCamera CinemachineVirtualCamera;
void Start()
{
float screenRatio = (float)Screen.width / (float)Screen.height;
float targetRatio = screenAdapt.bounds.size.x / screenAdapt.bounds.size.y;
CinemachineVirtualCamera.m_Lens.OrthographicSize = targetRatio;
if (screenRatio >= targetRatio)
{
Camera.main.orthographicSize = screenAdapt.bounds.size.y / 2;
}
else
{
float differenceInSize = targetRatio / screenRatio;
Camera.main.orthographicSize = screenAdapt.bounds.size.y / 2 * differenceInSize;
}
}
@@lI-tm4qx You didn't set it up right. Watch a tutorial.
Thanks a lot!
how do you fit both width and height of the playground edge to the screen size at same time. you have shown weight and height edge fit on screen edge . but how to you do at same time???
Unfortunately that's not how screen's work. It would be impossible to factor in all screen aspect ratios to have a screen fit both height and width of an object. You could instead alter your object to fit the width and height of the screen, but that's a whole different video.
You sir have saved my ass in LD 47 :D
Huge thank you! :)
thank you
Super helpful!!!
thanks for the video, very helpful !! :D
how cam we do this for perspective camera?
your amaziiiiing Brooooo! i am new suscriber!! Thanks!!!!!!!!!!!!!!
Welcome brother :)
Life saver.
What if I'm not have sprite background, instead a skybox colour???
Thank you thank you thank you!
thank you so much
Thanks so much man!!!
10/10 thank u! :D
Your charm mate
what should i use instead of rink since my game is more like a normal game
Does this work for Platformer games (Mario Style) where the character is constantly moving and the camera must follow him?
Is there a way to make the view orthographic on one axis and perspective on another so if you move closer and further away, things would only get bigger/smaller on one axis? I’m talking about 3D not 2D games.
Very helpful.
can we use same with canvas?
i have problem when screen resolution changes my sprite images which are not part of canvas are get cut off.
Cool what happened if do that in not orthographic camer ?
Ty a lot bro
How to get rink???
THANK YOU SO MUCH!!!!!
Hey guys how do i set a start camera position, i'm making a 2d game and i want the camera to stay in the left border where start the game but if the user changes the resolution the camera goes further and swallow a little piece of the scene what should i do to fix this?
How do i make the camera stay in the start left border without swallow in it?
If you know where the edge of your game is, just set the cameras position to the position of the edge plus half screen width.
@@pressstart6864 ooh thanks man it worked ;) thanks for helping me from the bottom of my heart ;)
@@pressstart6864 I tried that. What if it doesn't work?
I'm looking for how to have different screen aspects for different scenes. It seems of you have landscape on the menu scene it does that for all other scene..where I want portrait. How world I do this?
thanks
You’re welcome
Thanks!
Hey, nice video!!
what does the "rink" is?
What is Rink
So what is Rink actually ?
Make sure to tag the camera as "MainCamera" otherwise you get a nullObject refference
what about UI canvas image can we set the camera size according to UI image on canvas??
Thats what I wanna know
Why is mine so zoomed in?
Hello Press Start, it is a nice Video, but useless for me because i dont have an Orthograpic camera. I have a Perspective Camera and the script dont work with this type of camera. So, do you want to make a whole new Video about the zooming from a Perspective cam? Would be nice!
I might make a more in-depth video down the road, but I covered this topic in one of the more recent videos. Here's the link: ruclips.net/video/4_HUlAFlxwU/видео.html
why it shows " camera does not contain main"....?
Tag your camera as the main camera
@@pressstart6864 Thanks a lot!!
Why do these formulas work?
love you dude, but does not work with cinemachine
Great video, but as I implemented it in my game of pong for android, it gets cut off at 18:9 screen ratio... works with every other screen size or ratio
if your issue is with the border wall colliders this video might help ruclips.net/video/rlLMwNI53Oo/видео.html
I am confused what is rink
www.google.com/search?q=rink&rlz=1C5CHFA_enFR739FR739&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjR2tHa8M3jAhUyzYUKHZmyD0UQ_AUIESgB&cshid=1563982469301000&biw=1440&bih=766&dpr=2
its a background image