100 UNITY TIPS!!! 🔥

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

List of all tips with links (copied from youtube comment):

1 Selection Outline

2 Pixel Perfect Camera

3 Sprite Y-based Sorting

4 Destroy delay

5 Create material from shader

6 Execute code without empty object

7 Save changes in play-mode

8 Random boolean

9 Struct instead of Class

10 Auto-statements

11 Coroutine(ception)

12 Animation script parameters

13 Focus in the animation window

14 Toggle between Curves and Keyframes

15 Reverse animation

16 Comparing distances quicker

17 TextMeshPro

18 SerializeField

19 HideInInspector

20 Rename a variable and keep the value

21 Folder shortcuts

22 Focus

23 Focus follow

24 Align with view

25 CompareTag function

26 Empty objects as dividers

27 Find objects with Component

28 Find assets of Type

29 Easily move lines

30 Documentation shortcut

31 Documentation History

32 Expand/Collapse All

33 Changing Editor Layout

34 Change editor colors

35 Tinting the editor in playmode

36 Toogle scene effects

37 Menu Item

38 Context Menu Item

39 Hiding layers

40 Locking layers

41 Layer sub menus

42 Global C# Defines

43 Color Picking

44 Copy/paste colors

45 Maximising Windows

46 Serialize Structs and Classes

47 Collision Matrix

48 Collider interaction Matrix

49 Math in Inspector

50 Locking the inspector

51 Inspector debug mode

52 Debug Log highlights an object

53 Styling in Debug Logs

54 Plotting debug values

55 Add Component shortcut

56 Importing save files

57 Keep photoshop layers

58 Gizmos

59 Custom Gizmos

60 Show/hide gizmos

61 Show/hide gizmos in game view

62 StringBuilder

63 ScriptableObjects

64 Scripts changes while playing

65 Custom Windows

66 Custom Inspectors

67 ToolsV

68 RectTransform in 3D

69 Snapping

70 Snapping options

71 Vertex grab

72 Manages Assemblies

73 WaitForSeconds & TimeScaleV

74 Cash variables

75 Never use Camera.main

76 Performant non-changing strings

77 Range attribute

78 Space attribute

79 Header attribute

80 Tooltip attribute

81 Asset Store in Editor

82 Merge scenesV

83 Duplicate

84 Duplicate array items

85 Editor Presets

86 Iterate over child objects

87 Change object order in Hierarchy

88 Save selections

89 Regions

90 Pause Editor through code

91 Frame Skip

92 Stats window

93 Profiler

94 Measure function in Profiler

95 Undocking the preview

96 Mute your game

97 Invoke Repeating

98 Frame Debugger

99 Physics Debugger

100 DON'T MAKE AN MMO RPG

👍︎︎ 10 👤︎︎ u/Crocktodad 📅︎︎ Jan 07 2019 🗫︎ replies
👍︎︎ 4 👤︎︎ u/kloeti666 📅︎︎ Jan 06 2019 🗫︎ replies

Nice tips, except the term for #74 is "caching" (from "cache") and not "cashing" :)

👍︎︎ 5 👤︎︎ u/ahcookies 📅︎︎ Jan 07 2019 🗫︎ replies

9 I think structs by default should be readonly. It can gets some performance boosts. A lot less spam on stack from defensive copies.

https://blogs.msdn.microsoft.com/seteplia/2018/05/03/avoiding-struct-and-readonly-reference-performance-pitfalls-with-errorprone-net/

👍︎︎ 1 👤︎︎ u/illuminati-reptilian 📅︎︎ Jan 07 2019 🗫︎ replies

Don't forget to click the f**king "Save Project" button everytime you make any changes to a material or scriptable object.

👍︎︎ 1 👤︎︎ u/ryanflees 📅︎︎ Jan 08 2019 🗫︎ replies

Im just writing stuff down and saving it for myself later. (yes im using reddit for my notes)

Plotting debug values : https://www.youtube.com/watch?v=thA3zv0IoUM&t=358s

Collistion interaction matrix: https://www.youtube.com/watch?v=thA3zv0IoUM&t=305s

Vertex grab: https://www.youtube.com/watch?v=thA3zv0IoUM&t=464s

Measure function in Profiler: https://www.youtube.com/watch?v=thA3zv0IoUM&t=588s

👍︎︎ 1 👤︎︎ u/DeJMan 📅︎︎ Apr 20 2019 🗫︎ replies
Captions
so while back we did a video on my top ten favorite unity tips well we see the 10 and we ratio by 90 that's right we're kicking off the New Year with 100 cool you needed tips and tricks that hopefully is going to make your life a whole lot easier about 100 bits easier to be exact also a huge thanks to all of you who've been checking out line of code to those of you who don't know we just launched a game dev clothing store and we're just really excited about it so if you haven't checked it out yet head on over to the line of code IO let's of course I think for that in the description all right 100 unity tips here we go so first tip you can change back to the old selection outline by going on the gizmos and turning on selection wire next you can use the pixel perfect camera component to get super crisp pixel art make sure to first install the package in the package manager you can sort sprites based on their y-value by going to the graphics menu in the project settings and setting the transparency sort mode to custom axis and the Y value to one if you want to destroy a game object but would like to wait a few seconds you can insert a delay as a second parameter if you right click on a shader and create a material it will create a material based on that shader and name it accordingly you can use runtime initialization onload method to execute code in your scripts without having to create an empty game object with a mono behavior copy components while in play mode and paste them back when not playing to save changes to randomly get a variable that is either true or false simply use this short statement consider using structs instead of classes when storing just a few variables because they can live in the stack which eliminates garbage collection right the beginning of the statement in your script and double press tab to generate the rest start a quarantine within another co-routine using this code snippet the animation window can be used to animate pretty much everything the cool thing is that this includes parameters in your own custom scripts you can use control a to select everything in the animation window and then F to frame it all you can use C to toggle curve view and K for keyframe in the animator you can reverse an animation by setting the speed to minus 1 when comparing a distance don't use vector three the distance instead subtract the two points and use square magnitude then square the number you want to compare with this saves a square root call which is really slow use text mesh instead of the fall text objects to get way more control and much crisper text at all sizes mark private variables with serialized field to make them appear in the inspector while still being private if you want to hide a public variable without making it private market with hiding the inspector use the formerly serialized as attribute to rename a field without losing its serialized value you can add folder shortcuts into your unity project to easily be able to open folders that you often use focus on an object by selecting it and pressing F first F twice if you want to follow the object around match the game camera to the scene view by selecting the camera in the hierarchy and pressing control shift F when comparing two tags try to avoid the double equals it's more performant to use the compared tag method you can use empty game object as dividers in your hierarchy to help organize your objects if you want to find all objects with a particular component just search for it in the hierarchy in project search t : scene shows only scenes T : textures shows only textures and so on pretty cool for quickly finding objects of a certain type use alt + arrow up and down to quickly move lines without having to copy and paste quickly navigate to the documentation for a component by hitting the book in the upper right corner do you need to know when something changed and how then go to the documentation versions to get links to termination for all previous unity versions hold down alt while expanding an object in the hierarchy to expand all child objects as well the same applies to collapsing unity is completely customizable you can move around windows until you're happy then save your settings as a new layout by going to edit preferences color you can adjust editor colors including the background color of the scene view you can also make the editor change color when playing the game by adjusting the play mode tint this is great so you don't forget that the game is running you can choose what effects to show in the scene view by going under the landscape drop-down at the top want to be able to quickly call a certain function simply use the menu item attribute to assign a function to a new menu item at the top of the unity editor and use the context menu attribute to do the same thing but adding the function to the context menu instead split up your object into layers to easily be able to toggle them on and off in the scene you can also lock layers to avoid accidentally moving objects that you don't want to select when creating layers or tax you can use a slash to create submenus to make it easier to organize your project use project settings player other settings and then scripting defined symbols to add global c-sharp defined to your project these can be used to omit or include code when compiling you can use the color picker to get colors outside of unity itself and copy-paste works on colors use Shift + space to maximize a window use the system that serializable attribute to be able to see an edit classes and structs in the inspector change which layers collide with which by going under physics and changing the collision matrix also this is how different colliders interact when all on the same layer if I had to get something to - down my body this might be it you can do math calculations inside of number fields in the inspector no need to bring out a calculator unity also allows you to lock the inspector this is especially useful if you open a second inspector because it allows you to copy values between two objects really quickly well set the 50 mark I think it was that calls for a sip of water well let's continue the drop down menu at the top of the inspector has a debug mode option when enabled this will display all variables including private ones when you sync debug that lock you can add a game object as a second attribute this will highlight the game object in the scene when clicking on the lock you can use simple styling in debug logs to spider up your console messages sometimes when you have a variable that changes over time it would be great if you could just see it on a graph luckily we can use animation curves to achieve this fairly easily using this code snippet you can quickly add a new script by pressing add component typing the name of the script and hitting Enter twice unity can read save files from programs such as Photoshop or blender and Maya no need to export to another format first to keep individual Photoshop layers when importing into unity simply save as a PSP file instead this does require you to install the PSD importer from the package manager assign gizmos to objects using the inspector choose your own custom gizmos by selecting other enable and disable gizmos categorically from the scene view you can do this for the game view as at the top the code hell plus au plus space plus world creates a lot of strings and memory garbage use string builder for concatenating multiple strings more effectively create your own editor objects using scriptable objects this is great for organizing game data like items or achievements in the Preferences window you can choose what happens when the script changes while playing pretty cool since a lot of the time weird stuff happens when you just continue playing you can easily extend the unity editor to add your own custom windows with tools and overviews we have a video on this I recommend you watch if you've never tried it out it's a lot of fun and if you don't want to create a whole new window you can simply create a custom inspector this way you can change how you display components in the editor to add buttons display more information and so on we of course have a video on that as well you can use the qwe rnt keys to click the swap between tools and you can actually use the rect transform tool to scale 3d objects it's perfect for scaling from bounce instead of around the pivot holding ctrl while moving an object snaps to position to full world units for more snapping options go to edit snap settings hold me to grab and drag objects by their vertices as well snap them to other vertices reduce C sharp compile-time by creating your own managed assemblies right-click in the project select assembly definition and move it to the folder you want now all scripts inside that folder will be compiled to this assembly yield return new waitforseconds one will never stop if time that time scale is set to zero to change this use wait for seconds real time instead you can store references to components that you're going to be using a lot in private variables to save on performance this is called caching never use camera main it literally does this behind the scenes oh the horror if you're using a lot of non-changing strings in your code you can use static read-only string to avoid allocating a bit of memory each time they're quite a few attributes that make your inspector life a lot easier here the ones that I use the most range allows you to create a slider that goes between the min and Max value space adds an empty space hello creates a tiny bit of text tooltip changes the tooltip when hovering over a variable now when visiting the asset store you can do so both using a web browser or from within the editor you can drag and drop one scene onto another to merge them easily duplicate an object by hitting ctrl D we also use the same command to duplicate array items you can use presets to save configurations for your components simply use the sliders in the corner to choose between presets or create a new one to loop over all direct children of an object use this code snippet use transform that set sibling index to change the order of objects in the hierarchy by a script save your current selection by going edit selection and choosing a number you can then load back the selection from the same menu or using the shortcut use regions to create collapsible sections in your code watch out this is a slippery slope that leads to very long scripts you can pause the editor at a specific moment during runtime by setting editor application that is passed to true the frame skip button next to pass can be used to proceed one frame at a time use the game stats window for a quick overview over your game statistics for more in-depth look at performance use the profiler window and you can use this code snippet to measure the execution of a function in the profiler get a closer look at what you are inspecting by right-clicking on the upper part of the preview to undock it and it will then act as any other window need a quick break from your games audio simply hit the mute button in the game view monobehaviour that invoked repeating does not stop repeating on the activated game objects go to window frame debugger to see a breakdown of how each frame is rendered you can also visualize physic shapes using the physics debugger it's great for spotting errors in colliders and finally for tip number 100 don't make an MMORPG seriously don't there you go that's 100 unity tips now there are of course a lot more actually I don't think there is I think we covered all of them but I'm sure you guys can think of more so please do share them in the comments and of course don't forget to check out line of code using the link in the description and that thanks for watching and I will see you in the next video let's do outtakes begin so yeah just happen well we see the 10 and we raised you by 9 gee thanks of the awesome patreon supporters who donated in November and special thanks to make a cane and your Canon ink Oh art Arman to VR systems extend the player infinity PBR Sybok mummy didn't Sullivan sheriff Abdullah Chris face Tamara Phi thanks along Luna set fins and fensky wa stress t Ronan Bruins cat no Kiyosaki Gregory Pierce Mary tweet cool Swedish key tips Rogers rock parent car Jackson / Campania Robert punt Erasmus Anthony patent of breezy James P - Mafalda bar John Shannon Alex Jerrod Sookie Travis Dylan Rudy in Toronto and Caston Sue Ellen
Info
Channel: Brackeys
Views: 409,395
Rating: undefined out of 5
Keywords: brackeys, unity, unity3d, model, texture, material, beginner, easy, how, to, learn, tutorial, tutorials, tip, game, development, develop, games, programming, coding, basic, basics, C#, 100, tips, 100 tips, 100 unity tips, tricks, 10, top, list, quick, best, practices, trick, faster, new year, 2019
Id: thA3zv0IoUM
Channel Id: undefined
Length: 11min 53sec (713 seconds)
Published: Sun Jan 06 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.