A Good Way to Name Game Objects in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.ค. 2024
  • ➤ Start making 2D Platformers Fast and Easy - u3d.as/2eYe
    ➤ Make and Sell Car Games in Unity - u3d.as/1HFX
    ➤ Wishlist my game - www.bloodandmead.com/steam
    ➤ Join the community - / discord
    ➤ Support on Patreon - / lostrelicgames
    0:00 Intro
    0:19 The importance of good naming
    0:47 Unity naming conventions
    3:30 Bad Vs Good naming
    4:40 Naming Groups and Categories
    5:53 Organisation Tips
    In this Unity Game Dev Tutorial you will learn about good naming conventions in unity, specifically how to correct name game objects in the Unity IDE as well as additional Unity workflow tips.
    Other Useful Videos:
    Advice for Game Dev Beginners - • The Path to Game Dev G...
    Enemy Agro System - • Enemy AGRO AI System i...
    My Devlogs:
    GameDev Chaos - • A Day of Game Dev CHAO...
    How I fixed my animations - • How I fixed my game's ...
    Nintendo Saved my Game - • Nintendo Saved my Drea...
    Subscribe for Unity and game dev tutorials
    bit.ly/2MpZ1ao
    #unity #gamedev #tutorial

ความคิดเห็น • 83

  • @SliderGamesStudio
    @SliderGamesStudio 3 ปีที่แล้ว +23

    I've also seen a lot of devs not using ctrl + f to focus on the search box. On hierarchy or project view, hitting ctrl + f focus on the search to start typing right away. After typing, pressing down on the arrows put your navigation into the assets/objects.
    So, frequently, when I wanna find an Asset, I press ctrl + 5 to go to project view, the ctrl + f to start searching.
    There are good assets that helps organizing the project too. One I like is Rainbow Folders. Another that helps is Mulligan renamer, which can rename many assets or objects with custom logic.

  • @VideoGameAnimationStudy
    @VideoGameAnimationStudy 3 ปีที่แล้ว +24

    Good to see you on the rise, mate!

  • @LostRelicGames
    @LostRelicGames  3 ปีที่แล้ว +3

    I appreciate all of you who took a moment to like/comment. It really helps others discover the content.
    Want to hang out? Come by the discord: discord.gg/yeTuU53

  • @crazyconan28
    @crazyconan28 2 ปีที่แล้ว +1

    Exactly agree with the tips of "whatever you decide, be consistent" and "write as you would for a stranger". The latter makes looking at old projects a much easier transition for yourself especially.

  • @banallsandwiches5390
    @banallsandwiches5390 3 ปีที่แล้ว +20

    Hey! This is my first time commenting, and I want to say, thank you for the tutorials and tips, you really helped me in my gamedev journey.

  • @MythicLegionDev
    @MythicLegionDev 3 ปีที่แล้ว +3

    Thank you for the tips! I've tried my best to keep my project organized through lots of folders and empty game objects, but adding prefixes should make finding things much easier!

  • @boloychaki6689
    @boloychaki6689 3 ปีที่แล้ว +9

    This is something I needed but didn't know I needed it, feels kinda weird lol

  • @crazyconan28
    @crazyconan28 3 ปีที่แล้ว +3

    Simple, Concise, and Effective. Thank you for the wisdom. Liked and subscribed!

  • @Adidaas
    @Adidaas 3 ปีที่แล้ว +1

    Awesome small bite size tips as always! Much appreciated.

  • @durgayadav3075
    @durgayadav3075 3 ปีที่แล้ว +3

    Yes I always messed up in the end of every project.... thank nice tip. I make your advice an habit for my upcoming projcts

  • @NamidaSai
    @NamidaSai 3 ปีที่แล้ว +1

    Very useful tips, thanks for sharing! 👌

  • @phickman7872
    @phickman7872 3 ปีที่แล้ว

    Another awesome and extremely informative video! I can't wait for Blood and Mead to come out!

  • @antounkassouf8644
    @antounkassouf8644 3 ปีที่แล้ว

    this helps way more than i expected and it's only been an hour

  • @ineeda12step92
    @ineeda12step92 3 ปีที่แล้ว +1

    Makes great sense, thanks!

  • @madladmalus414
    @madladmalus414 3 ปีที่แล้ว +1

    Very good and informative video👍

  • @ThaerRazeq
    @ThaerRazeq 3 ปีที่แล้ว

    Very useful 👍🏼 and subscribed ✌🏼

  • @halivudestevez2
    @halivudestevez2 3 ปีที่แล้ว

    I use folders... and starts with dobule digit numbers, like 10-Environment, 20-Actors, ... 80-UI. mt - perfix for material; ra- ready assests (ready to put onto scene, more meaning than a prefab, which can be a component of another object) Prefixes are great.

  • @almusik9596
    @almusik9596 3 ปีที่แล้ว

    These are great tips not only for Unity users but for software developers in every field: I work as a dev (not game related, game dev is just a hobby) and the same principles apply.
    One of the most overlooked is the need for clarity in naming and organization of the project, because even one or two month after you last worked on a piece of software you won't remember anything, so every thing need to be as clear as possible and thoroughly commented where naming alone isn't clear enough

  • @HezlitFR
    @HezlitFR 3 ปีที่แล้ว

    Great, concise and helpful. Thanks ;)

  • @tiffjam
    @tiffjam 3 ปีที่แล้ว

    Very good. Thanks.

  • @Fadrik
    @Fadrik 3 ปีที่แล้ว

    I always organize the project or files into folders but the prefix thing is pretty amazing, Thanks.

    • @LostRelicGames
      @LostRelicGames  3 ปีที่แล้ว +1

      A good folder structure is still recommended, I talked about it towards the end of the vid! :)

    • @Fadrik
      @Fadrik 3 ปีที่แล้ว

      @@LostRelicGames yeah I saw it. you can never not organize your files more lol

  • @reereechi
    @reereechi 3 ปีที่แล้ว

    Thank you helped me a lot!

  • @Rzorclw
    @Rzorclw 3 ปีที่แล้ว

    Ik this vid is kinda old, but I just wanted to note a naming convention I have: Basically for all my art assets, I'll add a prefix showing an abbreviated version of the game's name to show which game that particular asset is being used for.

  • @peanut3438
    @peanut3438 3 ปีที่แล้ว

    Thanks for the awesome vid!

  • @stefandomaradzki2947
    @stefandomaradzki2947 3 ปีที่แล้ว

    Simple and helpfull 👍🏻

  • @pixelasm
    @pixelasm 3 ปีที่แล้ว +2

    If I may add to this: Also name your source files and asset files at least partially the same, so that you can backtrack them from the asset names.
    Most times I use Photoshop, Illustrator, Cinema 4D or even After Effects to produce PNGs, JPGs and FBXs. As the source files get big over time I store them in another directory instead of the Unity folder system. That way I can use GitHub with Bitbucket to store and version the #Unity3D project without clogging the whole setup with tens of gigabyte.

  • @pr0ph3tz
    @pr0ph3tz 3 ปีที่แล้ว +1

    Nice videos 👍

  • @PauloHSousa237
    @PauloHSousa237 8 หลายเดือนก่อน

    Well... That's VERY good tips.

  • @DaniArkadia
    @DaniArkadia 3 ปีที่แล้ว +1

    Not that your organization tips aren't a good approach too, this approach is great too. personally I find organizing folders by feature type to be more in tune with the way I think about how to find something, my reason for doing this is that Unity already provides the means to search by type so if I want to see all types grouped together like that, I can just search by type (Although I see the point that you narrow the search down further with the naming conventions).
    My folder structure is something like this (Weapon -> Shotgun) then in that folder I will have subfolders for the types and generally keep the prefab in the shotgun folder loose. That way you can find everything related to that particular thing without doing a lot of searching (which is especially useful if you reset the serialized fields on a prefab and you need to figure out what you need to plug in there for example). I also keep a "_General" folder within each broader folder (in Weapon for example) and I'll put anything shared across multiple weapons there.

  • @elefantastique
    @elefantastique 3 ปีที่แล้ว

    We usually do this: SM_Table_01_A for Static mesh table type 1 variation/part A

  • @Marco-rv7ec
    @Marco-rv7ec 3 ปีที่แล้ว +4

    Hey, can you make a video about health bar on top of enemies, it would be very good :D

  • @NewtonJR1987
    @NewtonJR1987 3 ปีที่แล้ว

    Nice!

  • @UmarFarooq-cu3gw
    @UmarFarooq-cu3gw 2 ปีที่แล้ว

    Tree_Small_Pine and Tree_Big_Pine would be better naming convention as you can then differentiate between Big and Small trees by typing Tree_Small or Tree_Big

  • @nichegames9590
    @nichegames9590 3 ปีที่แล้ว

    Oh yeah. I've been using suffixes. I always have trouble finding my Unity game objects. I'm consistently inconsistent as well. Thanks for the tip.

  • @danielschulz7391
    @danielschulz7391 3 ปีที่แล้ว

    Coming from c# dev background and used to name in CamelCase, this prefix approach seems quit nice #thumbsup

    • @liamaspinall6906
      @liamaspinall6906 3 ปีที่แล้ว

      just recently what i thought was camelCase was actual PascalCase. just semantics but i thought it was interesting

  • @user-xk9ec1yf5j
    @user-xk9ec1yf5j 3 ปีที่แล้ว

    Благодарю, Джон.

  • @GingerNingerish
    @GingerNingerish 3 ปีที่แล้ว

    Thanks for the advice game dev dad

  • @watercat1248
    @watercat1248 3 ปีที่แล้ว

    Good tipe
    I like the idia off the type name

  • @koktszfung
    @koktszfung 3 ปีที่แล้ว

    I like to think of it like naming folder

  • @programinghub8497
    @programinghub8497 3 ปีที่แล้ว +1

    Pls make a video about how you make levels for your game it looks dope
    Pls make a tutorial 🔥🔥

  • @diggerfdf
    @diggerfdf 3 ปีที่แล้ว

    I use MacOS and Linux to develop. The only thing I really miss from MacOS is the color/tag system.
    Imagine how happy I was when I got those assets to Colorize and change the icons from folders and Hierarchy objects...
    I can't explain how awesome this improvements are! I colorize enemy with color red. So Enemy Scripts, Enemy Prefabs, Enemy FX, Enemy SFX, they all have the same color scheme. Sometimes is easier to click and find then using the search bar. (small to medium projects)

  • @frazoni.
    @frazoni. 3 ปีที่แล้ว +1

    Do you apply these same naming conventions to the gameObjects in the Hierarchy?

  • @fleity
    @fleity 3 ปีที่แล้ว

    Good naming conventions are absolutely necessary for any kind of project but what constitutes a good convention is relatively hard to define and varies project by project. However I would argue strongly against component types in naming conventions. Why? because the search field can search / filter by type using "t:AudioClip" (available from the button right next to it)

  • @ooonaekooo5056
    @ooonaekooo5056 3 ปีที่แล้ว +9

    *"ThePrefabThatSitsOnThePlayersHeadAKAHelmet"*
    AHAHAHAHAHAHAH

  • @dukewendel
    @dukewendel ปีที่แล้ว

    I fixed this issue by writing an ediutor script that applies labels based on file location so i can search stuff like "l: Assets/Sprites/UI/Score"

  • @Director414
    @Director414 ปีที่แล้ว

    Great video, as always, thanks!! :)
    How would you name parents and children? What do you suggest? Would you write out "Name_Parent_etc_etc" and "Name_Child_etc_etc"?

  • @itsME-dc4vm
    @itsME-dc4vm 3 ปีที่แล้ว +1

    Nice ;D

  • @equious8413
    @equious8413 3 ปีที่แล้ว

    MORNING FROM CANADA!

  • @maximeumbra7235
    @maximeumbra7235 ปีที่แล้ว

    Don't go any deeper than 5-6 layers of gameobject folders and any hierarchies that get moved should stay as shallow relative to the scene root as possible for performance reasons. Otherwise very much agree with these tips!

  • @liamaspinall6906
    @liamaspinall6906 3 ปีที่แล้ว

    Personally, I use folders, so many folders. Folders for days. But it makes it super easy to find anything. For example your Ui example, I'd have a folder / empty gameobject and have them all stored under there. I do however mostly make really small things.
    With naming scripts and functions i personally create many functions this allows me to go oh what does this do, oh, the function tells me what it does etc etc, imagine the person reading your code in a month will kill you if its illegible.
    Also, I know its for programming specifically by the book "Clean Code" is fantastic

  • @ScilexGuitar
    @ScilexGuitar 3 ปีที่แล้ว

    Liked the video before I watched it

  • @ibrahimsharckas8929
    @ibrahimsharckas8929 3 ปีที่แล้ว

    that was helpfull

  • @KuntoOdhiambo
    @KuntoOdhiambo 3 ปีที่แล้ว

    This good practice can save your project guys.

  • @inacioferrarini
    @inacioferrarini หลายเดือนก่อน

    Nice! Do you use the same prefixes for Prefabs and GameObjects in the Scene? Thanks!

  • @anjoomfaisal
    @anjoomfaisal 3 ปีที่แล้ว

    Christian Bale taught me how to name my game objects properly. I'm so happy. 🥺

  • @SilviaFoxtrisPriv
    @SilviaFoxtrisPriv 3 ปีที่แล้ว +3

    Wait, are we just gonna ignore PE_Piss or..?

  • @weckar
    @weckar 3 ปีที่แล้ว

    I see what you're doing with the prefixes, but I find in every case one of those prefix groups should *really* be a folder...

    • @LostRelicGames
      @LostRelicGames  3 ปีที่แล้ว

      100% folders are still recommended here. The prefix is just another layer of organisation ontop of a solid folder structure; for the purpose of lookups. I beleive I talk a bit about it in the later parts of the vid.

  • @nicobrentatinon5236
    @nicobrentatinon5236 3 ปีที่แล้ว

    Hello man! Can you make a tutorial on how to interact with other GameObject scripts? For example, From PlayerScript and an ObstacleScript? Just saw your video on how a parent script can interact with its child scripts. I want to learn how a parent script can interact with other parent script. I want to know your version of this! Thanks!

  • @foundx8426
    @foundx8426 3 ปีที่แล้ว

    Hello, may I know why underscore is preferred over a dash? If I use tree-pine, will I run into programming errors ?

    • @vast634
      @vast634 2 ปีที่แล้ว

      Old programming standard never to use any spaces in filenames or folders. Spaces might work, but can lead to errors when loading a single word is expected.

  • @grahamreid876
    @grahamreid876 3 ปีที่แล้ว +1

    Hey John! Noob here. Why use and underscore vs CamelCase or using spaces? Is that a preference, or is there a reason behind it? (I'm an artist first, so bare with me please 😅)

    • @LostRelicGames
      @LostRelicGames  3 ปีที่แล้ว

      Hi Graham! if it were code I would use primarily camelCase/PascalCase . Though I treat file naming a little differently. The underscores serve the purpose of separating category to make it a little easier to search for. In terms of artists, of all those i've worked with, none have supplied work with camel case, which is typically a programmers convention. Spaces could also work, though sometimes a file might need to be referenced directly though code, where spaces don't always play nice. I hope that answers your question ! :)

  • @simest45
    @simest45 3 ปีที่แล้ว

    Godot user here, I AM SO stealing this.

  • @EmptyHouseGuy
    @EmptyHouseGuy 2 ปีที่แล้ว

    Long time dev here, I find suffixes and prefixes to be insufferable and useless. Perhaps this is because I work in Unreal and the file type is displayed on the icon image, and you can already search by filter type within the content browser. Prefixes describing the file are just added noise, and underscores are strictly forbidden.
    I give things simple, often times fantastical names which makes them easier to remember, basically how the memory experts say you should connect an idea to another idea to remember it better. I called my custom foliage implementation "CavemanFoliage" because I felt like a caveman while building it's brutish approach, and this has worked wonders for memorability.

  • @hello.4693
    @hello.4693 5 หลายเดือนก่อน

    Didn't know Keanu Reeves uses Unity.

  • @unrealengine5-storm713
    @unrealengine5-storm713 2 ปีที่แล้ว

    I am absolutely the worst at organization. I have files allover my computer folders. Some in downloads some deep in a web of folders some on my desktop. I have multiple folders in my game project ..tons if unused assets and prototyping. I am the absolute worst with it. (I use Unreal).
    However my naming conventions are consistent

  • @asukaiwa5258
    @asukaiwa5258 2 ปีที่แล้ว

    0:43
    did anything one think this was an add .. no? only me ?

  • @scriptsthefamous2250
    @scriptsthefamous2250 3 ปีที่แล้ว

    please bruh do a how to name gameprojects please...

  • @alex2d324
    @alex2d324 3 ปีที่แล้ว +1

    Как "russian hacker" (ну, почти хакер :) - просто инди-разработчик, но таки russian)
    -хочу сказать Вам - Огромное Человеческое Спасибо!
    -Ваш подход к именованию объектов, очень похож на то, к чему я пришёл сам, набив перед этим множество "шишек"...
    И вот теперь Вы подтвердили его правильность!
    -Спасибо! :)

  • @m0391n
    @m0391n 3 ปีที่แล้ว

    This method has only one issue - you should remember all prefixes. I'm using folders instead of them. In any way, naming conventions are crucial, indeed.

    • @LostRelicGames
      @LostRelicGames  3 ปีที่แล้ว

      For sure, a good folder structure is essential, I discussed it towards the end of the video.

  • @scriptsthefamous2250
    @scriptsthefamous2250 3 ปีที่แล้ว

    dont forget money tree...i have one.

  • @somemore9784
    @somemore9784 3 ปีที่แล้ว

    This channel is better than Brackeys.

  • @AdamCheong
    @AdamCheong 3 ปีที่แล้ว

    Hungarian Notation anyone?

    • @LostRelicGames
      @LostRelicGames  3 ปีที่แล้ว

      Hungarian Notation typically refers to variable or function naming, though stylistically this convention could be considered HN! :)

    • @AdamCheong
      @AdamCheong 3 ปีที่แล้ว

      :) I was thinking in the vein of old m$ winforms stuff like lbl and cmd cbo and chk but anyway it was slightly sarcastic as you have no doubt guessed ;)