How to improve game performance | Unity 2019

In this video, I cover a range of techniques that you can use to improve the performance of your own game. Hope you enjoy 😊.
····················································································
TIME-STAMPS:
0:00 - Introduction
0:55 - Background Information about CPU and GPU
2:10 - Profiler
4:00 - CPU Techniques Intro
4:20 - Batching
5:13 - Texture Atlas
5:45 - Shadows, Reflections & Per Pixel Lights
7:00 - Code Optimisation
8:05 - GPU Techniques Intro
8:10 - Model geometry
8:33 - Lighting
9:12 - Textures
9:39 - Culling and LODs
10:33 - Occlusion Culling
11:25 - GPU Instancing
····················································································
BRACKEYS OBJECT POOLING VIDEO:
• OBJECT POOLING in Unity
····················································································
SOCIAL MEDIA
Instagram:
sketch343?...
Twitter:
/ sketch343

Пікірлер: 151

  • @eldoon6009
    @eldoon60094 жыл бұрын

    My god you scared me, my pc has been blue screening quite frequently and that bit at the strart gave me a fright xD

  • @osirisrex3499

    @osirisrex3499

    4 жыл бұрын

    r you using AMD rx5700xt?😥😥

  • @AhbibHaald

    @AhbibHaald

    3 жыл бұрын

    @@osirisrex3499 why? I'm planning to buy it, is it bad?

  • @habibsadkcetin5539

    @habibsadkcetin5539

    3 жыл бұрын

    Sir if you are using 32bit windows then your pc should've run with 4gb of ram . . Above that will couse blue screen . . İf its 64bit windows then you could use large number of ram gb (its more like what your cpu capable of . . İf your cpu was made for 32bit windows, then upgrading windows software to 64bit wont help) . . Long story short, if you are using 32bit, make sure you have max 4gb ram . . That was a huge issue for me long years ago, i stupidly upgrade from 4gb to 8gb ram but i was using 32bit lol (maybe im wrong, correct me if im wrong)

  • @eldoon6009

    @eldoon6009

    3 жыл бұрын

    @@habibsadkcetin5539 My windows version was most definitely not the cause of my problems. My 5.3Ghz CPU overclock was the problem lol.

  • @warsin8641

    @warsin8641

    3 жыл бұрын

    Bruh buy the new one

  • @karimgameil6240
    @karimgameil62405 жыл бұрын

    You've tackled a critical topic in game development industry in style. Subbed.

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks, I really appreciate it 😊

  • @amuletgames1046
    @amuletgames10464 жыл бұрын

    This is surprisingly informative, probably the best unity optimization video I have ever seen on youtube.

  • @LoidHDGaming

    @LoidHDGaming

    4 жыл бұрын

    Yeah, no kidding. The man blew it out of the park!

  • @oozly9291
    @oozly92913 жыл бұрын

    Incredibly well done! Tells you many optimization techniques that I would have never thought of like lightmaps

  • @orwell235
    @orwell2353 жыл бұрын

    The quality and the manner of giving the information are awesome

  • @aideniridescence1437
    @aideniridescence14373 жыл бұрын

    This is such a gem because it's great in explaining what the CPU and GPU does for games in general and who's in charge of specific workloads.

  • @GoldDeniel
    @GoldDeniel3 жыл бұрын

    This video is so compact, tells lots of info understandably. I'm a begginer dev, I'm working on 2 games to 2 platforms at the time, learning all the things I need to know to make games. One of them has a simplified atmosphere and the other one has a realistic one. Both of them needs to be optimised well, since one of them is for mobile and the other one is for VR, and Jesus... This video explained a lot that I didn't use to understand. Thanks a lot! Saved this video to my "programming" playlist. Keep up working like you've been!

  • @N19ht96
    @N19ht965 жыл бұрын

    Nice! Took you long enough to make a video! But I prefer quality like this better than more video. A video like this teaches me a lot! Thank for uploading!

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    True that. I'll always make sure quality comes before quantity 😊

  • @nocultist7050
    @nocultist70504 жыл бұрын

    I was recently on unity forum and I was struck when people defended bad performance of HDRP on low and mid-range hardware by saying it's designed to be a AAA rendering pipeline XD So is Fox Engine and it rocks stable 60 fps no matter what in every game on any device with barely any difference in visuals across all graphics settings profiles.

  • @UGuruz
    @UGuruz5 жыл бұрын

    Just found your channel.. and I must say your work is amazing.. You level designing and rendering skills are awesome. Keep up the good work..😍👍

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks, I really appreciate it 😊

  • @Falesam
    @Falesam5 жыл бұрын

    Dude... thanks for this! I really appreciated... I put a link of your video in my projects card workflow as permanent for always consulting. All the great success!

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks, I really appreciate it 😊

  • @the_fun_one
    @the_fun_one3 жыл бұрын

    really helpful and a complete guide and most important it actually works. thanks a lot.

  • @quoctuanlee3544
    @quoctuanlee35443 жыл бұрын

    It's really informative. Thank you!

  • @marcitakacs6906
    @marcitakacs69064 жыл бұрын

    I learned a lot of new things man thank you!

  • @joshpolman201
    @joshpolman2014 жыл бұрын

    Awesome video man, thank you very much!

  • @victorenrique1019
    @victorenrique10193 жыл бұрын

    Awesome video. Great insights, very short and informative. Subscibed!

  • @altgal2856
    @altgal28565 жыл бұрын

    Finally! Can't wait to see more u awesome videos.

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks 😊

  • @kadent2634
    @kadent26345 жыл бұрын

    Awesome job on this vid sketch. Congratulations on 2k! Remember what I recommended at 1k?

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks 😊

  • @royog3088
    @royog30884 жыл бұрын

    Very important video , Thanks.

  • @infiniteheaven8681
    @infiniteheaven86814 жыл бұрын

    Truly excited for Cyberpunk 2077 like scene name haha

  • @ajayvijayh
    @ajayvijayh5 жыл бұрын

    Very Informative video. Thanks!

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    That's awesome to hear, thanks 😊

  • @PoRtOx91
    @PoRtOx914 жыл бұрын

    Nice tips. Thank you!

  • @sagarverma7670
    @sagarverma76705 жыл бұрын

    Best guide on KZread in unity

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks, I really appreciate it 😊

  • @sohailfarooq2066
    @sohailfarooq20664 жыл бұрын

    You are genius and very creative. I love your videos and learn so much from you. Keep up the good work bro. I hope one day i also create stunning landscapes like you ☺️

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    Thanks, I really appreciate it :D And I'm sure one day you'll be making awesome landscapes!

  • @UserRandomized
    @UserRandomized4 жыл бұрын

    Awesome advice, thank you.

  • @markvincentdimailig1137
    @markvincentdimailig11374 жыл бұрын

    This is really helpful thank you

  • @leonardojensen2654
    @leonardojensen26543 жыл бұрын

    Wow Occlusion Culling made my fps go all the way to Mars, you saved me! I'm definitely subscribing for more content similar to this.

  • @aashutoshdabhade4325
    @aashutoshdabhade43253 жыл бұрын

    Wow! This is mind blowing!

  • @sketch3436

    @sketch3436

    3 жыл бұрын

    Thanks :D

  • @woodstock2789
    @woodstock27894 жыл бұрын

    Such great and very high useful information. Thanks to your video I now have a better playable open world scene. I received a big decreased in verts and tris as well as a great increase in the fps. Big thank you.

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    That's awesome to hear :D

  • @woodstock2789

    @woodstock2789

    4 жыл бұрын

    @@sketch3436 I ran into a little issue do to not knowing scripts. I'm trying to make objects in front of my camera disappear when at farther distance. Do you have a video for that?

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    @@woodstock2789 You could add a LOD group to the gameObject and set a cull distance, or you could create custom culling distances for different layers using: Camera.layerCullDistances docs.unity3d.com/ScriptReference/Camera-layerCullDistances.html Hope this helps :D

  • @marcmantra
    @marcmantra3 жыл бұрын

    It's a VERY good video, and so clear. I want to add another optimization technique: texture array and instance indirect

  • @sketch3436

    @sketch3436

    3 жыл бұрын

    Thanks for the additional tip, appreciate it :)

  • @KiliGraphics
    @KiliGraphics3 жыл бұрын

    Omg you really got me with the bluescreen

  • @PandemoniumGameDev
    @PandemoniumGameDev4 жыл бұрын

    Thanks a lot!

  • @ziaulhasanmozumder7152
    @ziaulhasanmozumder71525 жыл бұрын

    good one :3 learned some new stuff.. more on this please :3

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    That's awesome to hear 😊

  • @deyaaomer8615
    @deyaaomer86154 жыл бұрын

    great Work Man

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    Thanks 😊

  • @marck0zz
    @marck0zz3 жыл бұрын

    Thank you!! That helped me a lot in my game. Is there something more to do in a HDRP project to improve performance? Thank you again!

  • @jonilo8792
    @jonilo87924 жыл бұрын

    Good vid!

  • @omarhidoussi1557
    @omarhidoussi15574 жыл бұрын

    Hello , i'm developer from raven Prod . Thank you for the help

  • @Golemofstone
    @Golemofstone5 жыл бұрын

    Nice video, and Yeah i'm excited for Cyberpunk 2017 too :D

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks 😊. It's awesome to hear that you saw the message I was wondering how long it would take people to notice 😂

  • @Golemofstone

    @Golemofstone

    5 жыл бұрын

    @@sketch3436 No problem, i always find your vids highly informative and useful, Keep doing what you're doing mate :D P.S You deserve way more than the 2.1k subs

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    @@Golemofstone Thanks I really appreciate it 😊

  • @viratgangurde
    @viratgangurde4 жыл бұрын

    Thanks for covering most of performance points. 1. Is this applicable for Unity 2019.3 LDRP? 2. I have suggestion that reduce background audio so it will be improve your voice quality.

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    The tips are more general and don't adhere to any specific pipelines so it should work fine with LDRP :) Also, I agree the audio isn't the best, this is the only video I recorded using my laptop which is why it sounds strange.

  • @ererbe

    @ererbe

    3 жыл бұрын

    AS far as I know you maybe need to disable srp batcher if you want to use gpu instancing because both together dont work. Thats just maybe a thing, but which one of these two gives you better performance depends on your project.

  • @SMC-TRADING
    @SMC-TRADING4 жыл бұрын

    great video

  • @_wise_one
    @_wise_one5 жыл бұрын

    More on this please

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Will do 😊

  • @dimitriskoutris6139
    @dimitriskoutris61394 жыл бұрын

    hello! Regarding texture atlas the only step u need is uv them together? ty in advance..u're awesome

  • @Ryan-xq3kl
    @Ryan-xq3kl3 жыл бұрын

    TOO MANY GOOD IDEAS!!!!

  • @xueliangji7846
    @xueliangji78464 жыл бұрын

    感谢分享

  • @Thatsmahnut
    @Thatsmahnut5 жыл бұрын

    here before 50 views

  • @TANMAN47TANMAN
    @TANMAN47TANMAN4 жыл бұрын

    The ai chicka song? nice.

  • @hagki
    @hagki Жыл бұрын

    This is what the indie dev needs. they have a good storyline but the performance game is not too

  • @000Gua000
    @000Gua0004 жыл бұрын

    Excluding voice record quality, it's the best video on the topic of optimization. Great job! But couple things bother me. Isn't pixel light count only applicable to forward rendering path? While in different all lights are basically pixel light and adding new light isn't as taxing for performance as in formward mode. Also occlusion culling is actually bad for large open scenes. Cause there are basically almost no objects to effectivally occlude other objects and enabling occlusion culling isn't free. It does consume CPU resources, so for open large scenes you most likely that you'll get better performance by not using occlusion culling. Limiting camera render distance and masking transition to "nothing" with fog is another great method to improve performance. But you do need to blend that fog into skybox and there's different methods to achieve it, depending on skybox technique that is being used.

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    Thanks, Gua I really appreciate it. I agree the voice recording was poor, and I didn't realise until later in editing and at that point, I couldn't be bothered having to redo everything. Regarding, pixel lights the forward rendering pathway is the only one that deals with them differently in terms of performance, so I wouldn't, be surprised if per-pixel light count only affects the forward pathway, however, I'm not too sure as the documentation doesn't give any explicit answers, if you any info let me know. I agree with what you say about occlusion culling, I probably should have put some extra detail in for that section. Thanks for reminding me about the fog masking technique I had completely forgotten about it, if I do another performance video in the future I'll be sure to mention it. Thanks again for all the feedback on the video I really appreciate it 😊

  • @000Gua000

    @000Gua000

    4 жыл бұрын

    Your welcome. Lightning fidelity and performance is the main difference between forward and rendering path. That's why most AAA titles deferred. It's brought app in every article on this topic. Here's first link from google blog.theknightsofunity.com/forward-vs-deferred-rendering-paths/ Unity official docs docs.unity3d.com/Manual/RenderTech-DeferredShading.html docs.unity3d.com/Manual/RenderTech-ForwardRendering.html If I remember correctly post effect are alo way cheaper in deferred.

  • @ArunKumar-fx7zc
    @ArunKumar-fx7zc3 жыл бұрын

    Hi! i am new to unity and oculus go. I am doing a school project where i have created a scene and uploaded in the oculus go. I am experiencing lag whenever i move and i have animation the the scene which i also lagging. When i move my head, the scene takes time to load and the color is distorted ( all pink,green) before returning to the original surface texture. I am not giving a very detailed description as i am a beginner but do you have any advice to solve this lag?? I really need the user to move smoothly.

  • @abhay_s_y
    @abhay_s_y4 жыл бұрын

    I M THE 1K LIKER

  • @AnwarA.
    @AnwarA.4 жыл бұрын

    I’m trying to use occlusion culling in my scene but i have some objects that have an animation that i want to be displayed, so I can’t mark them as static. Any advice?

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    Occlusion culling is precalculated and therefore, if objects are moving the occlusion culling can not appropriately cull the objects, so I assume animated objects will not work. However, you can still set animated objects to be static on the occlusion variables and they will still animate so you may be able to correctly cull them by using an occlusion area: docs.unity3d.com/Manual/class-OcclusionArea.html

  • @AnwarA.

    @AnwarA.

    3 жыл бұрын

    Sketch Thank you! :)

  • @user-og6hl6lv7p
    @user-og6hl6lv7p3 жыл бұрын

    Here's a few extra code optimisation tips for reducing garbage collection so you can free up memory: Don't use generic collections use arrays instead. Use for loops instead of foreach loops Reduce the number of new object calls inside of update loops, try creating vars/objects during the start procedure. Reduce the number of scripts containing mono-behaviours and try to incorporate a more polymorphic class inheritance approach. If you have an array of objects that you reference a lot use integers to refer to the index location of the object instead of copying the object every time you reference it.

  • @rohanjain5869
    @rohanjain58695 жыл бұрын

    Can you make a video on gun recoil like pubg pc, most videos on youtube make a simple weapon pushback and call it recoil. Nice work keep it up!!

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks for the suggestion, I'll add it to the list 😊

  • @554darren
    @554darren4 жыл бұрын

    but can it run crysis?

  • @ziaulhasanmozumder7152
    @ziaulhasanmozumder71525 жыл бұрын

    Hey show us how to use the new terrain tools (use of noise and stuff) sam just introduced that mins ago, may b in the next video? #video_suggestion

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks for the suggestion, I'm planning to do another follow along tutorial were I will go over the new terrain features 😊

  • @Justicefu

    @Justicefu

    4 жыл бұрын

    @@sketch3436 hey mate, great content. profiling stuff will be super helpful rather than trying to learn it all from scratch when the time comes would be great to have an HDRP guide similar to your post processing guide, things a monster.

  • @DanIel-fl1vc
    @DanIel-fl1vc4 жыл бұрын

    I've made hundreds of models and populated my scenes with them, they're all under an empty. If I wanted to use occlusion culling or shadow maps. Would you just select all of them, make them static and click some button somewhere. I attempted this in the past and it never worked, recall it even crashing at one point while baking shadow maps. The game runs fine in the editor but when you create a player and run the game in fullscreen it's about 45fps and 20 if you open a menu. I looked at the profiler and seems rendering is what is causing the lag, hiding the light and game objects increases performance by 50% so it's probably the real time shadows in the case of the menu it might be some script that is constantly looking for something. So frustrating but I suppose increasing performance is what you do at the end of the game's development.

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    If the scene is really big occlusion culling and baking lighting can actually cause issues due to how big the file size will be, also especially with baking the lighting large scene take absurd amounts of time to compute. It's hard to diagnose performance without seeing the actual scene, but from what you say make sure you have LODs on your models to reduce the stress on rendering, additionally, if they are sharing the same material make make sure to enable GPU instancing on that material, if there is a lot of different materials/textures the might be causing memory issues that will slow down the scene so either reduce the texture resolution or create texture atlases for your models. Turn off shadows for models that are small and hard shadows over soft, also if you have lights that don't move set the mode to mixed (assuming your not baking the lighting). Also, since you have many objects make sure that you are not using 'gameObject.Find' commands in your scripts (unless on Awake or Start) as this command will search through all objects. For your menu make sure the UI is not using any extremely high resolution image when it isn't need. Performance is something you should be fixing throughout development, do not wait till the end. When you add new features always view the performance, if there is a decent drop you know that what you added can be improved, whereas if you waited to the end you will have no idea what aspects are causing the largest drops in performance. Hope this helps a little, I know performance can be a massive pain and there is no easy fix, the more you debug this stuff the better you will get.

  • @DanIel-fl1vc

    @DanIel-fl1vc

    4 жыл бұрын

    @@sketch3436 Invaluable advice, I tried changing the sun light to mixed but didn't seem to affect fps. LODs for trees might be a good idea since there are lots of them in the scene. And I did use GPU instancing or I am using them. But if you make an object static it seems it ignores the GPU instancing. I tried which gave better fps and having the object be static improved the fps by 15% compared to GPU instancing so I guess it's preferable. As for the ingame menu, I'm loading it as a scene async on top of the current scene. So effectively two scenes are loaded at the same time. I suspect this is what's cutting the fps in half and not the menu itself. Because it's just some sprites and buttons. How could those half the fps. Do you think it's best to load menus in a separate scene on top of whatever scene you're in? Or should you somehow have the scene appear in every scene? Maybe make a prefab out of the entire menu or something.

  • @TYNEPUNK
    @TYNEPUNK3 жыл бұрын

    scared me too!

  • @asrielmandrak7220
    @asrielmandrak72205 жыл бұрын

    Do you have this scene from video? If you have, could you put a link do download?

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Unfortunately, I no longer have the scene. I only made the project for getting visuals for this video and that was it

  • @susmitdas
    @susmitdas5 жыл бұрын

    Do you know how to animate a nice, short film in Unity? And did you use another mic? The other one sounded better.

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Yeah I know how to make short films like cutscenes if you're interested in that I would suggest having a look at mixamo and cinemachine for Unity. It was the same mic but the location was different when I was recording so that's probably what is causing the difference.

  • @susmitdas

    @susmitdas

    5 жыл бұрын

    ok, got it!

  • @snakeplisken4278
    @snakeplisken42784 жыл бұрын

    How about best methods to change between large open world scenes?

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    Larger scenes are always a lot harder to manage in terms of performance. I didn't really talk about large terrains mainly since I feel I'm not knowledgeable enough yet. The largest terrain I have worked on is 4km by 4km. For that scene the biggest challenge was to reduce drawcalls, so LODs were extremely important, every model in that scene had multiple LODs. Also, it's important to note that occlusion culling wasn't used, for large scale scenes the file size of the occlusion maps will actually lower performance. Those two were the two biggest things, however, we did use essentially all the tips suggested in this video with a lot of fine-tuning and testing. Transitioning between different scenes will either need a loading screen, perfecting the above techniques will lower the load time or you can dynamically load the scenes while the player in-game using allowSceneActivation or you can have it all in the one scene and use object pooling (this does mean you will need one longer loading screen at the start). allSceneActivation documentaion: docs.unity3d.com/ScriptReference/AsyncOperation-allowSceneActivation.html Hope this helps.

  • @BestemmieDraconiche
    @BestemmieDraconiche4 жыл бұрын

    I'm a total noob. Lets say we have a weapon with all the internal parts. If you shoot with the weapon you can't see the internals, this still impacts on the performance? (I can't delete the internals because i need them when i disassembly the weapon in the game.

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    The poly count of your weapon would be less if the internal parts were not present, therefore, it would be more performant. However, the impact on performance would be very minimal in comparison to other aspects (lights, not having LODs, reflections etc). I would not worry about the rendering of the internal parts at all unless you are really struggling with performance. Hope this helps 😊

  • @BestemmieDraconiche

    @BestemmieDraconiche

    4 жыл бұрын

    @@sketch3436 thank you so much!!!

  • @ryanmob7648
    @ryanmob76484 жыл бұрын

    Can i do this on game the forest?

  • @jacko3764
    @jacko37645 жыл бұрын

    i swear if the next video isnt the 2k special im going to un-generate your mitmaps!

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    I wouldn't count on it, by the way, you don't generate mipmaps

  • @beatsbybrandon902
    @beatsbybrandon9023 жыл бұрын

    0:30 "But can it run Cyrsis?" Was that a thing or am I just too observant?

  • @misterkuda704

    @misterkuda704

    3 жыл бұрын

    yes i also saw that

  • @Lithrus_
    @Lithrus_4 жыл бұрын

    This is a great video, but if I could offer some feedback, I don't like the microphone audio. It's not clear or easy to understand and sounds off. Sure there's no static but every word sounds like a bass drum

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    Totally agree with you. I recorded the audio on my laptop instead of my PC for this video and it seems that the output is different despite the same mic, I didn't realise how poor the quality was until I heard by other videos which by then the video was already uploaded. I'll likely remove this video and redo it.

  • @dlxinteractive
    @dlxinteractive3 жыл бұрын

    Does bloom hurt performance? 😬

  • @sketch3436

    @sketch3436

    3 жыл бұрын

    Any post processing effect has to do some sort of calculation(s) and re-render so yes bloom would technically lower performance. However, out of all the post processing effects bloom is a pretty cheap one so don't feel discouraged from using a bloom effect even on mobile. Screen Space Reflections is the one you have to look out for that can make a noticeable drop in performance. Hope this helps :)

  • @dlxinteractive

    @dlxinteractive

    3 жыл бұрын

    Sketch So that’s a big relief

  • @watercat1248
    @watercat12484 жыл бұрын

    I have 1 questions haw to chenge haw fur see the camera with unity c# code

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    You can change a camera's render distance by changing the far clipping plane, this can be done on the camera component itself. For code it would be: camera.farClipPlane = [whatever value you want (float)]; If you want to target specific layers you can use: float[] distances = new float[32]; //array for all possible layers float[3] = 10; //Change layer 3 cull distance to 10 camera.layerCullDistance = distances; Hope this helps

  • @watercat1248

    @watercat1248

    4 жыл бұрын

    @@sketch3436 the you the only person you answer that question I try If my method works will have so mach better performance my idea is Depending on the area the player are to change the camera distance for example if the is insade on small room the don't need too see The same distance wean in the outside of that room The way I make that system is with onTrgerrigerEnter or else onTriggerStey

  • @watercat1248

    @watercat1248

    4 жыл бұрын

    @@sketch3436 1 other questions haw to chenge camera layers with code?

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    @@watercat1248 I would not recommend creating a script to dynamically change layer culling, since, every time you change a cull layer distance it has to go through every object in the scene to update them. However, what you are suggesting sounds exactly like occlusion culling. Occlusion culling is when the camera only renders what it can see, so if you're inside a room then all space outside the room will not be rendered. This is integrated into unity already and is really easy to setup Window > Rendering > Occlusion Culling, then just click bake the default settings are good enough. Note, that occlusion culling only applies to static objects. Documentation: docs.unity3d.com/560/Documentation/Manual/OcclusionCulling.html

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    @@watercat1248 Not to sure what you mean, do you refer to the layer culling distance or how to change a gameObjects layer via code?

  • @yashthakare57
    @yashthakare575 жыл бұрын

    Add a tutorial on making pedestrians AI

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks for the suggestion, AI would be a good topic to cover. Regarding pedestrian AI it is a lot easier than you think, here is a quick overview to help you out: Create NavMesh of the environment by setting objects to static and then navigate to Window > AI > Navigation and select ‘bake’. Create a pedestrian gameObject that has a NavMeshAgent (add from ‘Add Component’) this handles the movement. Then create a series of waypoints (empty gameObjects) along your streets we will use them to access their transform to make our AI move to. Using the NavMeshAgent property ‘destination’ you can set a location of where you want your AI to move to, you can also use ‘pathStatus’ or ‘remainingDistance’ to then apply the next waypoint. Here is the documentation: Destination: docs.unity3d.com/ScriptReference/AI.NavMeshAgent-destination.html pathStatus: docs.unity3d.com/ScriptReference/AI.NavMeshAgent-pathStatus.html remainingDistance: docs.unity3d.com/ScriptReference/AI.NavMeshAgent-remainingDistance.html For vehicles give them a ‘Nav Mesh Obstacle’, this will mean that is the player blocks the street path with a car than the pedestrian won't be stuck but rather just walk around the car. Nave Mesh Obstacle: docs.unity3d.com/Manual/class-NavMeshObstacle.html Although, if the pedestrians will never have any obstacles, then only create a NavMesh on the paths themselves this means you no longer need repeated waypoints rather just end locations. You can create different animation depending on the AI state using, Animator.SetBool: docs.unity3d.com/ScriptReference/Animator.SetBool.html For additional detail, you could add a Physics.OverlapSphere to the player to see what is within a certain radius of the player and then if the player is travelling at a certain velocity (i.e. speeding in a car) then make the pedestrian’s panic, i.e. change animation and make them run away from player etc. docs.unity3d.com/ScriptReference/Physics.OverlapSphere.html Hope this helps 😊

  • @yashthakare57

    @yashthakare57

    5 жыл бұрын

    @@sketch3436 Love your Videos. I have an idea for a game would you like to collab with me.

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    @@yashthakare57 Thanks for the offer, it is awesome to hear that you want to collab. Unfortunately, I am already working on freelance projects and lack the time to start anything new. I still wish you all the best though for your game 😊

  • @yashthakare57

    @yashthakare57

    5 жыл бұрын

    @@sketch3436 OK Thanks. Please tell that how to make online multiplayer server of a Game. Thanks for that AI .

  • @musicteam5211
    @musicteam52113 жыл бұрын

    Where is the solutions ?? You only said something about problems but there is no solution in your video... If we must not use update function , what can we use??

  • @derickriedel4350
    @derickriedel43504 жыл бұрын

    what a SCARE

  • @tecnotips4749
    @tecnotips47493 жыл бұрын

    i really thought i had a BSOd

  • @sagarverma7670
    @sagarverma76705 жыл бұрын

    Can please make a vedio on c# scripting

  • @sketch3436

    @sketch3436

    5 жыл бұрын

    Thanks for the suggestion, are there any particular areas you are interested in programming

  • @sagarverma7670

    @sagarverma7670

    5 жыл бұрын

    @@sketch3436 no but if you make tutorials for c# it will be very helpful and please make basic to advance

  • @chriswong225
    @chriswong2253 жыл бұрын

    i will give you 100 thumbs if i can on youtube, thank you so much

  • @DeathGOD7
    @DeathGOD74 жыл бұрын

    Crysis = cryengine

  • @sketch3436

    @sketch3436

    4 жыл бұрын

    That is true, I was referencing crysis in terms of the joke "can it run crysis" not the engine

  • @DeathGOD7

    @DeathGOD7

    4 жыл бұрын

    @@sketch3436 ohh you mean game debug like profiler..hehe ok sorry

  • @ManMadeOfGold
    @ManMadeOfGold3 жыл бұрын

    Not here for the video just here to say that it's dumb to use a render of Alcatraz from Crysis 2 (which runs on CRYENGINE) for a unity tutorial

  • @rafaelportugal5261
    @rafaelportugal52613 жыл бұрын

    Repent ye: "For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord." Romans 6:23 Jesus Christ loves you: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." John 3:16 "Mortify therefore your members which are upon the earth; fornication, uncleanness, inordinate affection, evil concupiscence, and covetousness, which is idolatry:" Colossians 3:5 "These things I have spoken unto you, that in me ye might have peace. In the world ye shall have tribulation: but be of good cheer; I have overcome the world." John 16:33 Read Revelation 18