Responsive Camera Design in Unity

  Рет қаралды 42,949

Tarodev

Tarodev

Күн бұрын

Пікірлер: 89
@alexcubed4270
@alexcubed4270 2 жыл бұрын
0:30 question: when you create a new Bounds, doesnt it set the center to 0,0,0, meaning that 0,0,0 would always be included in the bounds if you do it like that?
@Tarodev
@Tarodev 2 жыл бұрын
You're right about this, good pick-up. I suppose I didn't catch it it as the maps always included zero here... Fix would be making the centre one of the objects.
@Tarodev
@Tarodev 2 жыл бұрын
Pinned this, BTW
@alexcubed4270
@alexcubed4270 2 жыл бұрын
@@Tarodev wow that was a quick reply, thanks!
@alexcubed4270
@alexcubed4270 2 жыл бұрын
@@Tarodev hey my first pin, thanks! It would be useful if Bounds had a builtin static method to create a new bounds from an enumerable of other bounds. I've needed that functionality quite often and am kinda surprised its not built in to unity
@Tarodev
@Tarodev 2 жыл бұрын
@@alexcubed4270 yup, that'd be an amazing addition. To be honest unity could add a whole bunch of great helper functions like that
@luqal7112
@luqal7112 2 жыл бұрын
What the.. Didn't know you can return type like that.. Wow.. Knowledge keep on expending. Btw nice responsive design.
@Tarodev
@Tarodev 2 жыл бұрын
Named tuples babe
@adityapratama1891
@adityapratama1891 2 жыл бұрын
It's kinda remind me of with Js
@Tarodev
@Tarodev 2 жыл бұрын
@@adityapratama1891 the deconstructing part is very similar to js
@Vastlee
@Vastlee 2 жыл бұрын
@@Tarodev time for another convention war? camelCase vs PascalCase for Tuple naming. I always fell into the PascalCase because of the accessibility levels and the fact that the unnamed convention is Item1, Item2 but the bag of variables argument tracks too. No dog in that fight, but you know, anything for those engagement points :)
@Tarodev
@Tarodev 2 жыл бұрын
@@Vastlee my heart cannot handle another convention war 😂
@fulongfromthegrave
@fulongfromthegrave 2 жыл бұрын
Straight to the point and a very useful trick! Bounds work in mysterious ways. I used them yesterday to dynamically figure out the size of a box trigger in my scene based on how many items are in it.
@Tarodev
@Tarodev 2 жыл бұрын
Very nice sir
@speedfastman
@speedfastman 2 жыл бұрын
That font in the thumbnail do be looking real nice.
@hackbeam
@hackbeam 2 жыл бұрын
Rigth straight to te point. Very usefull algorithm in less than 2 minutes. I didn't know about the Expand() method of the Bounds class. Thats a huge discovery! Thank you, you gained a subscriptor for that
@youcancallmedoggie
@youcancallmedoggie 2 жыл бұрын
Amazing video Mr stranger! Keep em poppin!
@Tarodev
@Tarodev 2 жыл бұрын
Hey... I know you
@youcancallmedoggie
@youcancallmedoggie 2 жыл бұрын
@@Tarodev I will steal this code by the way! Gonna use it on my new blockbuster game!!
@PitiITNet
@PitiITNet 2 жыл бұрын
Woah! Great video, short and to the point! I love the editing!
@Tarodev
@Tarodev 2 жыл бұрын
Learning some new tricks here and there...
@FakeMelon
@FakeMelon 2 жыл бұрын
Awesome video, as usual :D
@turkeyjerkey
@turkeyjerkey 2 жыл бұрын
Excellent tutorial and well-explained. Easy to adapt to my grid-based game, and works like a charm! Much simpler than my code based off calculating the grid aspect ratio vs. the screen aspect ratio. Thanks!
@torzukki
@torzukki 2 жыл бұрын
Great tutorial. Very glad I found your channel!
@robelso5646
@robelso5646 2 жыл бұрын
This is exactly what I was looking for, thanks a lot!
@SpicyMelonYT
@SpicyMelonYT 2 жыл бұрын
I would love if you made a video about async extension methods. Something about them are so amazing like the stuff in Dotween that you showed off. Maybe even make the video as an exploration video where you explore what you can make instead of what you already have prepared for the video. But yeah honestly everything you make is enjoyable for me. Thanks man
@Tharky
@Tharky 2 жыл бұрын
Wonderful tutorial! I'll absolutely use this idea when I make my own puzzle game (someday)!
@jumpingman6612
@jumpingman6612 2 жыл бұрын
Neat! Will try it out for my school project.
@shasvatnayak2329
@shasvatnayak2329 2 жыл бұрын
The information and presentation in this tutorial is on another level, thanks a ton!🤗
@smecherul003
@smecherul003 2 жыл бұрын
Cinemachine is a more simple and more powerful option but for some basic smoothing this tutorial is great .
@Tarodev
@Tarodev 2 жыл бұрын
Don't have to convince me, I love cinemcahine. Although I would prefer to use this script over cinemcahine if this is all the camera requirements of the game.
@MaKimProjects
@MaKimProjects 2 жыл бұрын
Just this past week I implemented something far worse to solve for keeping objects in view on different devices. Great info and... now it's time for me to refactor.
@maxfun6797
@maxfun6797 2 жыл бұрын
Wow the graphics on this tutorial.
@ikenna2058
@ikenna2058 2 жыл бұрын
Hi Tora, please can you do a video on how you make your game graphics look really good. And btw, love your videos.
@jopaslona1
@jopaslona1 2 жыл бұрын
Right into the point, thak you! I will use this trick in my next game!
@VictrisGames
@VictrisGames 2 жыл бұрын
This is very useful! Thank your. I’m going to update the GDevelop extension that follows multiple objects using this logic.
@KushagraPratap
@KushagraPratap 2 жыл бұрын
1:22 * giggle *
@Tarodev
@Tarodev 2 жыл бұрын
😁
@matthewmathis62
@matthewmathis62 2 жыл бұрын
I was looking up how to do this recently, and I very much appreciate you making this video! It almost seems like it was made for me. Thanks for making this video. I really love this channel of yours! Actually, your last video about Naming Conventions (which I'm trying to adhere to) came out days after I looked into the topic... I find this strange. Are you spying on me?! :P
@galaxygur
@galaxygur 2 жыл бұрын
_buffer variable is not defined, should it be something like suggested by Copilot "bounds.size * 0.5.f" ?
@shinigamirealm9802
@shinigamirealm9802 5 ай бұрын
Hello, i know this is an old video but if youre still reading can you give follow up on how to add buffer properly? As buffer would be in world space and as camera size grows thay buffer will become smaller and smaller
@deveshsharma6609
@deveshsharma6609 2 жыл бұрын
Great tutorial , your videos helped me a lot , can you make one tutorial on 2d character swim underwater
@Tarodev
@Tarodev 2 жыл бұрын
I'll be adding this feature to my 2d controller, but yes that's a really good idea
@TopShelfCookieJar
@TopShelfCookieJar 2 жыл бұрын
Which font is that you're using in your code editor at 0:13? Looks crisp and clean!
@n_mckean
@n_mckean Жыл бұрын
When you add [ExecuteInEditMode] it doesn't seem to automatically adapt in the Simulator, unless I start Gamemode. Any ideas?
@RaonCreate
@RaonCreate 2 жыл бұрын
nice! thank you
@treppas
@treppas 2 жыл бұрын
So cool 🤯!
@chaostellar
@chaostellar 2 жыл бұрын
NICE
@IPlumpton
@IPlumpton 2 жыл бұрын
Great tutorial, thanks! I assume for a perspective camera it's easier just to use Cinemachine maybe?
@Tarodev
@Tarodev 2 жыл бұрын
Yeah, I would probably just default to that 😊
@SweetHoneycode
@SweetHoneycode 2 жыл бұрын
I see what you did there: "the luxurious 6/9 ratio."
@libiroli
@libiroli 2 жыл бұрын
"Illustrious." Even better.
@SaiponathGames
@SaiponathGames 2 жыл бұрын
Really cool!
@derpenz5376
@derpenz5376 2 жыл бұрын
Why is the center Vector on the last number at -10 instead of 0?
@Silen1t
@Silen1t Жыл бұрын
question; Where do I Attach the script ?
@Kidopya
@Kidopya 2 жыл бұрын
Hello, could you please make a tutorial for split binary aab files for aab files exceeds 150 mb for google play store. Since google play does not accept apks any more its fairly complicated for beginners. Thanks for great tutorials and awsome videos!
@watercat1248
@watercat1248 2 жыл бұрын
Okay but what happened if the game have custom resolution For example in the game im working on the have the opinion off window mode and the player able to get whatever size the window teknlcly the don't have I spefic aspect ratio ? And what happened if the camera is not orthographic ?
@Tarodev
@Tarodev 2 жыл бұрын
This works for any resolution and aspect, it'll adjust to always fit your scene objects on the screen. Not applicable for perspective camera
@watercat1248
@watercat1248 2 жыл бұрын
@@Tarodev what do you mean by Sean objects ? to by honest the reason I'm interested in my game is the UI in my game What I want to do is to make wean the player has different aspect ratio to move or chenge the UI position and size for example when Saman 5:6 aspect ratio to have the position off the UI I little differently same if the use vertical monitor It's is pasble to do samthin like that ?
@Tarodev
@Tarodev 2 жыл бұрын
@@watercat1248 ​ UI Scaling is a whole other thing. I have a responsive UI design video. This one is for game objects
@watercat1248
@watercat1248 2 жыл бұрын
@@Tarodev okay
@GreLLPro
@GreLLPro 2 жыл бұрын
Thanks! But... Why you must multiply bound.size.x by aspect ratio? I'm a little confuse
@BobrLovr
@BobrLovr 2 жыл бұрын
Why is x the only thing affected by aspect ratio? Why don't you have to do that for y?
@TheDeadlyDalek
@TheDeadlyDalek Жыл бұрын
Is this needed with the pixel perfect camera? It seems the pixel perfect camera should handle this for you but its not scaling my game up at different resolutions I choose in the resolution drop down.
@ЕвгенийКуркин-ц3ш
@ЕвгенийКуркин-ц3ш 2 жыл бұрын
Thank you very much for the lesson. I have a question, I have an area on the canvas (for example, Image) in which I want to arrange the created gameobjects in the form of a game field using your example. with the setting of the camera position for the center of the game objects and the area, everything works out for me. But it is not possible to make the necessary orthographicSize so that they fit in the area. Are there options for how to do this?
@CheeseChuckie
@CheeseChuckie 2 жыл бұрын
Hello friend, do Patreons get downloads of these projects?
@luizthiagosouza5377
@luizthiagosouza5377 2 жыл бұрын
I never thought that Unity supports tuples.. How long ago?
@Tarodev
@Tarodev 2 жыл бұрын
Quite some time now brother 😊
@MrSmartass42
@MrSmartass42 2 жыл бұрын
But you didn't tell me to like, subscribe and hit the bell? jkjk good stuff! Thanks!
@martijndrenth2727
@martijndrenth2727 2 жыл бұрын
Amazing video and content, but mannn the title is off Edit: Much better now!
@Tarodev
@Tarodev 2 жыл бұрын
What do you mean?
@SystemOfATool
@SystemOfATool 2 жыл бұрын
@@Tarodev it is indeed a bit off. The video is about making a camera that is responsive to the level design, it doesn't really have much to do with game design. But who cares, you don't even need titles, we'd all still click on your videos!
@Tarodev
@Tarodev 2 жыл бұрын
@@SystemOfATool well, I do want accurate titles. I figured responsive design in the same sense as a responsive website. I should probably change it to 'responsive camera design'. Thanks boys, I'll do it shortly
@itzfried
@itzfried 2 жыл бұрын
This could be very cool for a Smash Bros type camera, focussing on all players
@MarkRiverbank
@MarkRiverbank 2 жыл бұрын
This was specifically a head-on orthographic camera, like a puzzle game. But, Cinemachine already has “Target Group” and “Look At” functionality that gets you most of the way to a Smash Bros type of camera.
@itzfried
@itzfried 2 жыл бұрын
@@MarkRiverbank Ahh okay, thanks! Never used cinemachine, yet. Only the standard orthographic cam
@LocalContentShow
@LocalContentShow 2 жыл бұрын
Cinemachine really is as good as advertised for what it's worth. In the new GMTK series he spent DAYS creating a custom camera system only to realise that Cinemachine did it better, easier.
@MarkRiverbank
@MarkRiverbank 2 жыл бұрын
@@LocalContentShow yes, it’s a phenomenal package. It’s one of several areas where Unity does laps around Unreal in quality-of-life for indy developers.
@blazereaper1761
@blazereaper1761 Жыл бұрын
Nice
@matthigamer1
@matthigamer1 2 жыл бұрын
But why get the pixelHeight and pixelWidth for the ratio when you can just call _cam.aspect? (Or 1 / _cam.aspect if you want height / width) 😅 Anyway great video as always. 😄
@emanueltejadacoste2250
@emanueltejadacoste2250 2 жыл бұрын
Pretty adavanced, i didnt get a single shit out of this video xd
@あれくす
@あれくす 2 жыл бұрын
lol.... illustrious aspect ratio
@Tarodev
@Tarodev 2 жыл бұрын
😜
Timetrial Ghosts in Unity
3:16
Tarodev
Рет қаралды 24 М.
Understanding Orthographic Size in Unity
6:14
Press Start
Рет қаралды 86 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
10 Things You NEED to Be Doing in Unity
11:40
Tarodev
Рет қаралды 138 М.
The Apps I Use to Design Games
26:07
AdamCYounis
Рет қаралды 140 М.
How To Render 2 Million Objects At 120 FPS
14:57
Tarodev
Рет қаралды 151 М.
Unity How to Lock Camera View to an Aspect Ratio and Add Black Bars
7:58
Lerping in Unity - You HAVE to know this!!
10:54
Tarodev
Рет қаралды 90 М.
Unity Collision Cheat-Sheet - Discrete vs Continuous
2:45
Tarodev
Рет қаралды 41 М.
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 794 М.
Better Coding in Unity With Just a Few Lines of Code
15:27
Firemind
Рет қаралды 319 М.
Unity Architecture for Noobs - Game Structure
16:24
Tarodev
Рет қаралды 209 М.
How To Make Your Game Look The Same On All Mobile Screen Sizes - Unity Mobile Game Development
7:50
Awesome Tuts - Anyone Can Learn To Make Games
Рет қаралды 161 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН