3D Tilemap in Unity

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024
  • I will show you how to use Unity's Tilemap system to create 3D Tilemaps.
    Kenney's Platformer Kit - kenney.nl/asse...

Комментарии • 220

  • @absolutewisp
    @absolutewisp 3 года назад +113

    Straight to the point, I knew everything I needed to know after no more than 4 minutes. Subbed and will check out your other content!

  • @TheAsarath
    @TheAsarath Год назад +5

    I watched multiple tutorials that were much longer than this one that didn't explain it as well as this video did in 4 minutes, thank you.

  • @connorgibes709
    @connorgibes709 Год назад +1

    Commenting to boost engagement. You're great at making videos like this, you didn't waste time with an intro, your voice is calm and slow and not annoying to listen to. Thank you!

    • @CabrielUngroid
      @CabrielUngroid 10 месяцев назад

      Totally agree. I would love to see some more videos on this subject from you. Great work!

  • @perico17
    @perico17 3 года назад +60

    If for some reason you can't find the "Tile Palette" option, click the "Window" tab at the very top, go to "2D" and click "Tile Palette". Then you can drag it onto the inspector like in the video.

  • @Grinwa
    @Grinwa 3 года назад +10

    Man u have a lot of potential of being a great teacher just like brakeys so plz don't stop u providing a really really cool content keep it up
    It's the first time i see ur channel and i think u doing great job

    • @vectorbread
      @vectorbread  3 года назад +5

      Thanks I really appreciate that! Brackeys is one of my favorites as well.

    • @Grinwa
      @Grinwa 3 года назад +1

      @@vectorbread don't worry bro if u keep making these cool videos am pretty sure u'll be there in no time
      Am just saying that bcuz i really love ur videos and many people will love ur work too

  • @theuser810
    @theuser810 3 года назад +8

    Simple, yet perfectly to the point! Thank you!

  • @St0n3dCold
    @St0n3dCold 3 года назад +12

    Thanks for the tutorial. I would recommend using different objects for edges and for landmass seperately, to increase performance

    • @vectorbread
      @vectorbread  3 года назад +6

      That's a great suggestion! I like that its a simple change which doesn't require any code.

  • @codemonkey5519
    @codemonkey5519 3 года назад +2

    omg thank you, i dont say this to every tutorial person but i love you

  • @ALZHEM
    @ALZHEM 11 месяцев назад

    Incredible tutorial. One of the best I have ever seen, and I'm not kidding.

  • @CulturedxIndie
    @CulturedxIndie 3 года назад +29

    OMG I'm new to game dev and I've been searching if this was possible. Now to see if it works dynamically. Hard sub from me, thanks

  • @JoshWeeks
    @JoshWeeks Год назад

    Just had to add to the chorus. This is a fantastic and extremely useful tutorial. Much appreciated.

  • @Christian-dd2qm
    @Christian-dd2qm 2 года назад +1

    Finally, a proper tutorial. Thank you.

  • @dogo1604
    @dogo1604 Год назад

    One of the best videos i have watched about level design. Thank you.

  • @franciscotoro1937
    @franciscotoro1937 Год назад

    Thank you!
    For anyone who wants to use polyperfect assets, set grid cell size to X=30 Y=30, Otherwise you will generate hundreds of objects

  • @kken8766
    @kken8766 2 года назад +1

    Good presentation, no bull shit, straight to the point. Thanks
    Job well done!

  • @pandashrinks01
    @pandashrinks01 3 года назад +6

    This is great!! Just got into tilemaps for unity. This has been a great help! Thank you so much! I'm subscribed and can't wait for your next video!! :)

  • @PhirstyMehn
    @PhirstyMehn 4 месяца назад

    Not what I was looking for but wow, this is cool!

  • @Park_SoYoung
    @Park_SoYoung 2 года назад

    Thanks to you, I succeeded in making the tilemap.

  • @CELUGames
    @CELUGames 2 года назад +2

    Thanks man! For me, who are migrating from 2D mechanics, understanding what I need to change in Unity in order to adapt to 3D is essential. Wow!

  • @danielmoreau9822
    @danielmoreau9822 3 года назад +1

    This is fantastic! Exactly what I was hoping to find,

  • @MasonWolf90
    @MasonWolf90 Месяц назад

    Thanks, this is just what I needed for my game!

  • @howl2339
    @howl2339 2 года назад

    Your voice is so calming

  • @irfyninja6843
    @irfyninja6843 5 месяцев назад

    your vids are great. hope to see more in the future!

  • @heliosgames6665
    @heliosgames6665 3 года назад +2

    I didnt know that was an option in unity! Thank you for the video :)

  • @tienvantheten8924
    @tienvantheten8924 7 месяцев назад +2

    great video! quick question tho is there a way to give the tiles collistion without creating 1 collider per block painted (the performance doesn't like that so much if i give the prefab where i paint with a collider)

    • @BRtn-nn9nr
      @BRtn-nn9nr 2 месяца назад

      The answer is yes and no. You can build your own script that will generate optimized box colliders from your tilemap (it's not easy), or you can extract the mesh from the tilemap and use it in a mesh collider (which is unoptimized, but still better than the example in this video)
      Best option to me is to use an asset on the Asset Store called Autotiles 3D

  • @soekma_aoeliea
    @soekma_aoeliea 3 года назад +1

    Using 2d tool for 3d, Nice! Simple and totally useful for me. Thanks!

  • @lapinranger7405
    @lapinranger7405 3 года назад

    I love you, I needed that, it's very well explained
    Your video and your voice are well made

  • @yaelcohen4734
    @yaelcohen4734 2 года назад +1

    this is amazingly helpful!! would love to see a tutorial on how to create a character on this kind of tilemap

  • @niyaziemre8540
    @niyaziemre8540 Год назад +1

    Thanks for the video its basic and efficent. But i want to ask you guys something my models size doesn't match with other models when using GameObject pallette (some are big some are small). How can i edit my models easily.

  • @markb6506
    @markb6506 3 года назад

    Wonderful video. Succinct, easy to understand, and very helpful! Thank you for providing these insights.

  • @messiah001
    @messiah001 3 года назад

    Never subscribed so fast to a channel. Thanks for sharing it with us

  • @eGregiousGames
    @eGregiousGames 2 года назад

    Love your channel and this video has helped me so much. I love your slow, calm, reassuring style; it's refreshing on RUclips to see someone who understands when to let your words breathe; I'm still learning how to do that myself. I'm creating a top-down game with pixel art that still has a Z plane, and this has really helped me create that world much faster the way I want to, just like painting a top-down map. Hope you come back to make more content, if you want to!

  • @jaycelee8453
    @jaycelee8453 3 года назад +1

    you have perfect voice for unity tutorial .

  • @selin9218
    @selin9218 4 месяца назад

    You are such a AWESOME guy. Thanks a lot.

  • @khazlol
    @khazlol 3 года назад

    Great video! Looking forward to more tutorials. Glad I found the channel :)

  • @RutherfordMRV
    @RutherfordMRV 2 года назад

    This is fantastic I've got a few ideas for a possible project with this in mind.

  • @usmanarshad855
    @usmanarshad855 3 года назад

    This is absolutely amazing video to kick start my day 😍

  • @tomasz4848
    @tomasz4848 8 месяцев назад

    This is so great, thank you mate!

  • @bluejay7071
    @bluejay7071 2 месяца назад

    Is there a way to switch between game objects on the same brush? There does not seem to be a clear way to easily change the object I am using.

  • @seespacelabs6077
    @seespacelabs6077 2 года назад

    Very concise and clear. Thanks!

  • @pratyushbarikdev
    @pratyushbarikdev 3 года назад +1

    I think I should explore 2D more. Didn't even know something like this existed. Thanks.

  • @FC-BS
    @FC-BS 9 месяцев назад

    how do you switch to game object brush? unity isn't allowing me to

  • @TheAtticus82
    @TheAtticus82 3 месяца назад

    Great video, dude! Just subbed.

  • @garywilkerson6395
    @garywilkerson6395 3 года назад

    This is my favorite youtube video...

  • @diogoico
    @diogoico 3 года назад +2

    Hello, thank for the video! I'v been trying to use the HasTile to verify is the ground tile map has a game object set but without any luck... do you know how could I do samething like that? I'm trying to verify if the player has a place to walk but HasTile always return false...

    • @vectorbread
      @vectorbread  3 года назад +4

      Hi Diogo! Unfortunately with this basic approach the Prefabs themselves are not considered Unity Tiles so we are placing them in the correct position, but the data in the Tilemap component is not being updated.
      I've made a Unity Component called `TileUnit` which will tell the Tilemap that the game object is taking up the tile at its position.
      Here is the `TileUnit.cs` File:
      gist.github.com/vectorbread/52ed2111f483a07e4a6520a116d6c1b7
      If you add the `TileUnit.cs` file to your project and add the component to your Prefabs then the Tilemap will automatically have its data updated when you start the game.

    • @diogoico
      @diogoico 3 года назад

      @@vectorbread Ohh I get it now so that is how it is... Thank you a lot for your help!

    • @Darkoddish
      @Darkoddish 2 года назад

      @@vectorbread First of all, thanks a lot for the tutorial, it is great and straight to the point and has helped me a lot. I've used your script and now HasTile() returns true as expected, but tilemap.GetInstantiatedObject() does not return anything. Any chance do you have a suggestion? Thanks a lot

  • @luizfellipe1206
    @luizfellipe1206 2 года назад

    Right to the point! great content, subbed!!

  • @sanogku474
    @sanogku474 Год назад

    Great video! got it working in minutes.
    Additional question, is there a way to programmatically add to the tilemap at runtime?

    • @vectorbread
      @vectorbread  Год назад +2

      Thanks! Yeah if you `Instantiate()` your prefabs with the Tilemap as the parent and use the Tilemap's `GetCellCenterWorld()` function to calculate the world position of the prefabs.

    • @sanogku474
      @sanogku474 Год назад

      @@vectorbread ooh that does work, thanks for the fast response !

  • @twentyonepotatoes0792
    @twentyonepotatoes0792 8 месяцев назад

    Great for beginners, Thank you!

  • @ceren5252
    @ceren5252 2 года назад +1

    Hi, I've just added the "2D tilemap" from package manager. However, at the brush window I am not having "gameobject.brush"... Where it is? I couldn't find this problem on google too :(((

    • @vectorbread
      @vectorbread  2 года назад +2

      Hi Ceren did you also install the "2D Tilemap Extras" package? That package should have the brushes in it, but it is hidden by default in the Package Manager see 0:29.

  • @gabryelhuneault1801
    @gabryelhuneault1801 2 года назад

    For some reason the package manger button isn't visible in the window. HELP PlEASE!

    • @vectorbread
      @vectorbread  2 года назад

      I haven't heard of this before but I can try to help. What version of Unity are you using? Can you share a screenshot somewhere? You can DM me on twitter if that helps twitter.com/VectorBread

  • @argtorr
    @argtorr 2 года назад

    when a I try to use the brush with the gameobject selected, I get this error: FloodFill not supported
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) ------- do you know why?

    • @vectorbread
      @vectorbread  2 года назад +1

      I'm not sure, but I'd guess its because the Game Object brush does not work with the FloodFill option for the Tilemap (or at least it doesn't work in all versions of the Tilemap Extensions). Likely it won't work unless someone made a custom version of the brush to fill out the FloodFill functionality.

  • @BroLygamingyt_999
    @BroLygamingyt_999 3 года назад +1

    Is your channel, Becuz i see ads is start and end , or just the RUclips new rules

    • @vectorbread
      @vectorbread  3 года назад

      I think you're asking if the channel is monetized. It's not because you need 1000 subs to be able to monetize. It is indeed RUclips's rules forcing ads on the video. From what I understand once I hit 1000 subs I can manually turn off ads on each video, but I hear it won't show up in search results much anymore if I do that. If I get that many subscribers I'll try turning the ads off or putting the ad at the very end so people can just watch without waiting for an ad.

    • @BroLygamingyt_999
      @BroLygamingyt_999 3 года назад

      @@vectorbread New Rule sucks , Bruh

  • @JDee06
    @JDee06 10 месяцев назад

    Is it possible that I can place in-game gameobjects like roads on the tiles?

  • @j_ordinary4252
    @j_ordinary4252 2 года назад

    The 2D Tilemap Extras package doesn't show up for me. I couldn't find any solutions on the Internet either. Does anyone know where to find it?

    • @ilovewallacebuthategromit
      @ilovewallacebuthategromit Год назад

      It didn't show up for me either and it turned out to be because I was using a ver of Unity from 2019 or so, when I did the same search on a ver from 2022 the extras package showed up.

  • @FC-BS
    @FC-BS 10 месяцев назад +2

    Already lost from step one. It took me like 10 minutes to find the assets.

  • @АнтонАнтонович-л1д
    @АнтонАнтонович-л1д 6 месяцев назад

    Спасибо, что ты есть ♥

  • @AimedX3
    @AimedX3 Год назад

    Your video is so helpful, thanks.
    But i have a question, what if i wanted to make a mountain or a hole? Should i make a separate 3d model or make new tilemap layers?

  • @nietjoost
    @nietjoost 3 года назад

    I do not need it, but very good tutorial. Good and clear voice!

  • @jakubkadlec4285
    @jakubkadlec4285 3 года назад +2

    Nice video, exactly what I was looking for. Still, I've got one question. Is this better than instantiating tiles one by one as single objects speaking of performance? Thanks in advance

    • @vectorbread
      @vectorbread  3 года назад +2

      Great question! It's not any better for performance. In the levels I've built I haven't run into any performance issues so I wouldn't rush to optimize it, but there are a lot of options if you need to. Some of the more common optimizations include having multiple versions of the 3D tiles with only the visible faces you need, writing a script to group all the tiles into chunks and enabling / disabling the groups based on the camera position, and finally writing a script to generate a custom mesh based on the tilemap data.

  • @mickssss
    @mickssss 4 месяца назад

    hey, im encountering a problem where the ground is uneven. As a result, my character can't move smoothly across the ground. Do you have a potential fix for this problem?

    • @vectorbread
      @vectorbread  4 месяца назад

      @@mickssss there are a lot of possible ways you can run into this problem. If you’re using a Mesh Collider for your ground tiles then it’s possible the vertex positions need to be updated to be exactly the same between tile edges. Also the normals on those vertices might need to be fixed depending on your if your movement scripts use them. If possible I’d make simple tiles using box colliders to avoid having to deal with the 3D meshes.

  • @dwried
    @dwried 2 года назад

    You could technically do a 2d game, 2.5d game and a 3d game in different scenarios all in one with the right setup. I guess you would want to set up 3 different action maps for controls in the input system, since they would have different movements. I was already working on sort of a 2.5d game view that would go to 3d view during certain scenarios. I had pondered over tile maps, but didn't think it was too feasible. Composite 3d colliders would be somewhat nice.

  • @Vii13_
    @Vii13_ 2 года назад +1

    Hi ! I was wondering if you knew how to make it so there is a collider attached to the tile map (or the grid) itself. Basically, when I place the blocs for the ground, they don't have any colliders. I don't want to assign a collider to every single ground block, or I don't want to make it at runtime via a script because of the lag. So my question is, are there any ways to make it so there is only one collider for the entire tile map ? If not, is there a way to make it so the colliders of all the ground blocks collapse together to make one ( I know it's possible with 2D tile maps using the tilemap collider 2D component, but I'm not sure if it is possible in 3D ). I hope I didn't make it too unclear...
    Thanks !

    • @vectorbread
      @vectorbread  2 года назад +2

      Hi Victor good question! Honestly the simplest approach is probably the best to start with. For every game object you use as a tile make it into a prefab and attach a collider for the tile. This will result in a ton of individual colliders, but if you use simple colliders like box colliders it probably won't be an issue for most games.
      Alternatively you can create a script to generate a mesh from scratch based on the tilemap you draw and you can rebuild this mesh from the scene view so it does not happen during the runtime. This will be more efficient and result in just 1 mesh, but there are lot more steps and its not something I can go over completely in a comment.
      This unity doc page has some examples of how to generate a mesh using a script as a starting point:
      docs.unity3d.com/ScriptReference/Mesh.html
      Sadly there is not built in 3D tilemap or composite collider like there is for 2D tilemaps in Unity. Hopefully Unity will expand their tilemap functionality to work better in 3D.

    • @Vii13_
      @Vii13_ 2 года назад +1

      I really appreciate that even if the video is one year old, you keep answering questions, it really helps a lot !
      And wow, didn't expected an answer this quick ! Thanks !

  • @Docdoozer
    @Docdoozer 2 года назад +1

    Hello! I was wondering if there is a way to add a gameObject tile to the tilemap through code because I can't seem to get tilemap.SetTile(Vector3Int position, TileBase tile) to work since I can't assign a gameObject as a tile through code. I've looked through the documentation, both the official tilemap and tile documentation but also the one for this package and can't find anything. Is there a way to do this or a better solution?

    • @vectorbread
      @vectorbread  2 года назад +3

      Hey Docdoozer! If you want to set a Tile through code you need a Unity Tile object to pass to the Tilemap. You can create new Tile objects using this line of code:
      ScriptableObject.CreateInstance();
      I have a helper class that I often use which I place on game objects under a Tilemap and it will automatically find the Tilemap it is under and create a new Tile object and set the Tile on Tilemap.
      Here is the helper class I use:
      gist.github.com/vectorbread/52ed2111f483a07e4a6520a116d6c1b7

    • @noobcola
      @noobcola 10 месяцев назад

      @@vectorbread I was just about to ask the same thing! Thank you for sharing that script!

  • @TechWrathTV
    @TechWrathTV 3 года назад

    hi, its not showing any other brush. Only showing default brush. How to see other brushes?

    • @vectorbread
      @vectorbread  3 года назад

      Have you installed the `Tilemap Extras` package from the Unity Package Manager? The extra brushes should appear after it is installed. 0:26

    • @TechWrathTV
      @TechWrathTV 3 года назад

      @@vectorbread now cannot see extra package on unity. please check.

    • @vectorbread
      @vectorbread  3 года назад

      It’s hidden by default in the Package Manager. You need to change the Package Manager settings to show Preview Packages and change the Package Manager drop down to show all packages (instead of just the ones in your project).

    • @TechWrathTV
      @TechWrathTV 3 года назад +1

      @@vectorbread Just checked, the preview package now is only visible for UNITY 2020 onwards, We were using 2019 version and it didn't show preview package for tilemap. Just adding to information.

    • @vectorbread
      @vectorbread  3 года назад

      Oh wow well that explains why you weren’t seeing it. Thanks for figuring that out it will help others who run into it too!

  • @GemGameDev
    @GemGameDev Год назад

    Strong video, thanks for explaining that. Are you working on a game rn? Keep it up!

  • @CheesePizza_GameDev
    @CheesePizza_GameDev Год назад

    straight up man , bada bing bada boom

  • @jeffreyjumisko5165
    @jeffreyjumisko5165 3 года назад +2

    Is each square tile object in your map 1m x 1m in the Unity environment? I'm interested in creating my own tile set in Blender.

    • @vectorbread
      @vectorbread  3 года назад +3

      They were in my video, but you can change the Cell Size of the Grid / Tilemap in the Inspector to a different size if you want.

    • @jeffreyjumisko5165
      @jeffreyjumisko5165 3 года назад +1

      @@vectorbread Thank you for responding to my question. This tutorial is really helpful for relatively new game designers!

  • @phatly
    @phatly Год назад

    with tilemap, which collider should be used? It's won't work with tilemap collider 2d

    • @vectorbread
      @vectorbread  Год назад

      Hi Phatly the Tilemap Collider 2D only works for with the other 2D Colliders and if you have 3D models like the above video then you probably can't use it. You will probably want to use regular 3D Colliders on the individual game objects.

  • @atamaminami5752
    @atamaminami5752 2 года назад

    Is this capable of autotiling, or are the meshes just overlapping? Thanks for the video!

  • @calendulaprox2155
    @calendulaprox2155 Год назад

    Thank you for your knowledge

  • @mathdantastav2496
    @mathdantastav2496 2 года назад +1

    isn't that just gonna instanciate a bunch of separate gameObjects and not merge their meshes into one (as you should do if you want decent performance)

    • @vectorbread
      @vectorbread  2 года назад +1

      Yep you're right it is going to instantiate a bunch of individual gameObjects and components. I will say from my experience my old laptop could handle 10000s of simple cube tiles with no problem or optimizations. Also it seems like chunking the tiles into groups that you show / hide based on the camera location has the best improvement on performance. And of course creating a custom mesh like you said helps as well.

  • @OverAndOverAndOver
    @OverAndOverAndOver 2 года назад

    Is there a way to make this procedural?

  • @techgeektw
    @techgeektw 3 года назад

    Installed it in Unity 2019.4.25 but its not showing game object brush option.

    • @techgeektw
      @techgeektw 3 года назад

      2d Tile Extra is not working from GIT and is now not available from package manager. Any help would be great

    • @techgeektw
      @techgeektw 3 года назад +2

      Hi, found the answer, I downloaded this from GIT separate and copied the brush scripts folders in assets.

    • @torq21
      @torq21 3 года назад

      @@techgeektw Thanks for this!

    • @techgeektw
      @techgeektw 3 года назад

      @@torq21 my pleasure

  • @foresight9688
    @foresight9688 2 года назад

    Does the 3d tilemap allow something similar to a composite collider,having loads of 3d colliders seems memory intensive

    • @vectorbread
      @vectorbread  2 года назад

      No unfortunately it doesn't. I'd love for Unity to introduce true 3D tilemaps so we can can get things like composite colliders. In my experience you can get a lot of box colliders in the scene before Unity starts to struggle. If you do do start having issues you can split your world up into chunks and hide the ones far from the player. Worst case you would have to write a custom script to generate the collider mesh from the tile data.

  • @diamondgelato
    @diamondgelato Год назад

    very informative and concise video, it was very easy to understand and implement but when i started paintint the tiles unity editor crashed :(

  • @iR3dyOfficial
    @iR3dyOfficial Год назад

    Is there a more efficient way to add mutliple levels vs adding new tilemaps for every tier?

    • @vectorbread
      @vectorbread  Год назад +1

      Great question unfortunately I don't know of a better approach yet. Ideally Unity will come out with a version of the Tilemap with 3D in mind which has a more natural way to handle multiple levels.

  • @miladh8749
    @miladh8749 3 года назад +1

    Hey, thanks for the video!!!! Is this also able with hexgrids?

    • @vectorbread
      @vectorbread  3 года назад +1

      Yes it does work for hexgrids! If the brush is putting the model off center from the cell you clicked then play with the `Offset` and `Anchor` properties on your brush. I had to set both to 0 to make sure my model was put in the center of the hex cell.

    • @miladh8749
      @miladh8749 3 года назад +1

      @@vectorbread Thank you! Now it works :)

  • @franekdomanski7288
    @franekdomanski7288 3 года назад +1

    YOU ARE THE BEST :)

  • @mediabass
    @mediabass 3 года назад +1

    This is great, definitely going to use this. Just one thing which could be improved. You have to dragdrop gameobjects to the brush all the time. Is there anything possible to speed this up?

    • @mediabass
      @mediabass 3 года назад +2

      I have found something helpful myself ;) you can use the 'Pick or select new brush (i)' tool in the toolbox. When clicking on a gameObject you can draw start drawing that object on other places on the grid. This makes it very fast. Also, the tilemap is just an editor tool. Every placed object is a normal gameObject as if it isn't placed with the tilemap. Which means you can move/rotate or do whatever with a gameobject after placing it in the tilemap.

    • @nether6209
      @nether6209 3 года назад

      @@mediabass that's really good

    • @seigen9388
      @seigen9388 3 года назад

      @@mediabass can you show where is toolbox please? I can't find it

  • @coffeecupstudios5701
    @coffeecupstudios5701 2 года назад

    First off, great video, very well put together and helpful! I have a quick question, I'm working on an RTS game and wondering because you are painting so many 3D box objects for the ground. Will it cause performance issues for large scale environments at all since Unity has to render so many boxes or would you say that's fine? The reason I ask is I'm currently using terrain builder for my levels but contemplating switching to a grid terrain as I was advised (and can see) the advantages of doing it for an RTS game. Appreciate any advice here as code and game optimisation is something I know very little about xD

    • @RepDev
      @RepDev Год назад +1

      For every single object the game will do a draw call. It's best to keep the draw calls to a minimum. Using the gameobject brush is fine and all, but should mostly just be used for prototyping an eviorment or sketching (unless your environment is really small then it don't really matter). If you want to optimize it you need to either make a copy of the tilemap in a program like blender or bind the meshes together into 1 with some coding. If you wanna challenge yourself do the latter since It's usually easier depending on what your doing and also a good learning experience about coding with 3D meshes.

    • @DisturbedNeo
      @DisturbedNeo Год назад +1

      Since your camera is going to be pointing at the ground, you could probably improve performance a lot just by enabling Unity’s built-in occlusion culling.
      Otherwise, because this is just scene geometry, you can mark the objects as static so that they get batched, which massively saves on draw calls.
      And then, if you’re still having problems, consider merging and baking the meshes so that they’re essentially treated as one big “ground” object instead of many objects.

    • @coffeecupstudios5701
      @coffeecupstudios5701 Год назад

      Thanks @RepDev and @DisturbedNeo. I've since stuck with Unity's terrain tool since it seems more straightforward but will keep your advice in mind as I build up more experience moving forward.

  • @ARGallardo_
    @ARGallardo_ 3 года назад

    1:51 it dosn't appear this option to me. Why? :v

    • @vectorbread
      @vectorbread  3 года назад

      Not sure. The brush should show up after you install the 2D Tilemap Extras. What version of Unity are you using? And which version of the 2D Tilemap Editor package did you install?

    • @ARGallardo_
      @ARGallardo_ 3 года назад

      @@vectorbread Unity version: 2020.1.6f1
      2D Tilemap Editor: Version 1.0
      It dosn't appear other version in the Package manager ;_;

  • @abdou023
    @abdou023 3 года назад

    Can you add custom data to these object and manipulate them after painting?

    • @vectorbread
      @vectorbread  3 года назад

      Yeah they are normal game objects so you can put any custom scripts you want on them and after painting them you modify their properties individually if you want. Also you can make prefabs of game objects with different custom data and paint which ever prefab you want so they don't all have the same starting data.

  • @beanieMp4
    @beanieMp4 11 месяцев назад

    LIFESAVER THANK YOU

  • @Mimimimikimi
    @Mimimimikimi Год назад

    If you make a cube and use it to make the map, the parts that the player can't see are still loaded by the computer?

    • @vectorbread
      @vectorbread  Год назад +1

      Yes they are still loaded by the computer. If you wanted to improve performance you could write a script to group the cubes into chunks and hide / show the chunks depending on the distance / direction from the camera. But I would avoid adding this extra logic until you start seeing issues in performance. Usually the computer can handle a lot more cubes than we'd expect.

    • @Mimimimikimi
      @Mimimimikimi Год назад

      @@vectorbread thks

  • @GabeJ07
    @GabeJ07 2 года назад

    clever! thanks for sharing!

  • @enbermudas4269
    @enbermudas4269 3 года назад

    What about the performance? Looks like each ground tile created with the brush also creates a new game object on the scene. Is this good or does it ends up generating a bad performance?

    • @enbermudas4269
      @enbermudas4269 3 года назад

      Also, can I use the grid to create some sort of tactical movement or is it just to paint?

    • @vectorbread
      @vectorbread  3 года назад +1

      Good question. Its certainly not an optimized approach so performance may eventually become an issue. But when I played around with it Unity had no problem with pretty large amounts of tiles, so I would not worry about performance for most games. If you end up building a truly massive open world game with 3d tiles then you'll want to add a script which will group the tiles into chunks and only show the closest chunks to the player (which is pretty standard for any large map in a video game).

  • @hahahahahahahaha587
    @hahahahahahahaha587 6 месяцев назад

    OHHHHHHHHH! Are you a genius?

  • @milosancheztv8432
    @milosancheztv8432 Год назад

    this awesome omg !!

  • @waiissac1319
    @waiissac1319 3 года назад

    Can u rotate the game objects on the tilemap? How to do it?

    • @vectorbread
      @vectorbread  3 года назад +3

      Good question!! At first I thought the Orientation property on the GameObject Brush should rotate the game objects, but when I tried it out today it was using a Quaternion to set the rotation which is pretty unintuitive from the Editor. So unfortunately with the latest version of the Tilemap Extras I don't see an easy way to rotate the tiles. You can manually rotate the GameObjects after placing them or you can place your GameObject under another parent GameObject and rotate it under the parent in the Prefab editor then paint the parent GameObject.

  • @kannpai
    @kannpai 3 года назад

    Can you do multiple floors? Any way to 9-slice it like in 2D if so?

    • @vectorbread
      @vectorbread  3 года назад

      I usually make a new tilemap for each floor and set the offset on the brush to be the height of the floor I'm painting on. You can see me doing this at 2:31. I don't think you can 9-slice like 2D can. Unfortunately a lot features are missing when you try to use tilemaps for 3D. I hope Unity will release an update with better 3D support.

  • @YourRelaxingMusicChannel
    @YourRelaxingMusicChannel 3 года назад

    Thank you!!!!!!! Nice tutorial!

  • @Michael-qx7rg
    @Michael-qx7rg 3 года назад

    Thanks for the tutorial

  • @McPatoo
    @McPatoo 9 месяцев назад

    Holy duck, i was really wasting my time doing a level with probuilder, this looks better :D

  • @sagitswag1785
    @sagitswag1785 3 года назад

    Is this method any more/less performant than having gameobjects be instantiated on runtime? The reason I ask is because I am working on a procedurally generated open world game, and I will be instantiating maps at runtime anyway. I'm currently using an isometric tilemap, since it keeps active gameobjects to a minimum. Does this spawn a seperate gameobject for each active tile, or is it more similar to the 2D tilemap?

    • @vectorbread
      @vectorbread  3 года назад +3

      Good question this method is just instantiating game objects. So each painted tile will have a separate game object.
      If you are worried about performance I would work on grouping the tiles into chucks and only show the chunks which are near the player during runtime. If you still see performance issues with chunks then, you'd likely need to create a custom 3D mesh based off the tilemap data instead of relying on tiles or gameobjects.
      Each of these performance enhancements can be time consuming to create, so I'd hold off until you really need them.

  • @SwitchZetto
    @SwitchZetto Год назад

    That's interesting! Is it as optimised as 2D tiles?

    • @vectorbread
      @vectorbread  Год назад

      No its not optimized like 2D. I'd love for Unity to release an update with true Tilemap support for 3D. But you'll probably be surprised how far this unoptimized approach will go in a lot of games it will work fine. If you do run into issues the first optimization I would try is writing a script to group the tiles into chunks and hide and show chunks based on how close they are to the player.

  • @carlosrembrandtpinacisnero5971
    @carlosrembrandtpinacisnero5971 2 года назад

    May I ask you, how to add a collider

    • @vectorbread
      @vectorbread  2 года назад +1

      Good question! The easiest way is to add the collider to the ground tile prefabs you plan on using before painting with them. So for the ground tiles in my video I'd add a BoxCollider to the prefab.

    • @carlosrembrandtpinacisnero5971
      @carlosrembrandtpinacisnero5971 2 года назад

      @@vectorbread yieei, thnks. I will give it a shot. You are so great

  • @ramonsohal2404
    @ramonsohal2404 3 года назад

    Hey, thanks so much for sharing this! I have a question tho...I want the player to be able to instantiate an object (lets say a tree in your case) via clicking on the map. So in theory there should be a way to do the same "painting" thing through code right? I have however not found a solution to instantiate these Brush Objects in code. Any idea on how to go about this?

    • @vectorbread
      @vectorbread  3 года назад +3

      Hi Ramon! Good question and unfortunately this video won’t help in your scenario. You’ll need to a script that figures out where the user has clicked on the tilemap and instantiates the prefab at that position.
      Here is an example script I made that does this:
      gist.github.com/vectorbread/fac2fcacec189cded8c7cc79e8a4fa50
      It works by having a collider in your scene that represents the bounds of your tilemap. When the user clicks the screen it shoots a ray and sees where it lands on the collider. Then it converts that position to the center of the cell before instantiating your prefab.

    • @ramonsohal2404
      @ramonsohal2404 3 года назад

      @@vectorbread Thanks! I was tinkering with the internal ObjectBrush class that is used to paint objects via the UI and even got it to work by invoking it's Paint method, but that majorly messed with the physics loop and somehow seemed to break everything.
      Simply instantiating a prefab myself (at the correct position) works - thanks for the example :) The video is still super useful because I never knew you could swizzle the axis on the tilemap and that there even is the option to place real objects. That's really neat!

  • @DerClaudius
    @DerClaudius 3 года назад

    Thanks, Bread!

  • @Rubberduckerino
    @Rubberduckerino 3 года назад

    Can you also interact with the tilemap in game?

    • @Rubberduckerino
      @Rubberduckerino 3 года назад

      for example base building or RTS kind of games?

    • @vectorbread
      @vectorbread  3 года назад

      What kind of interaction did you have in mind? If you mean physics then you could add Colliders to the game objects you paint and your game characters could then walk on the tiles.

    • @Rubberduckerino
      @Rubberduckerino 3 года назад

      @@vectorbread more like placing objects in game itself just like a RTS or base builing game

    • @vectorbread
      @vectorbread  3 года назад

      @@Rubberduckerino Oh I see what you mean now! You would need a custom script to listen for the user input and then get the position on the map where to place the game object.
      Here is an example script called `MapClick` which will shoot a ray where ever you click and place the prefab in the cell you clicked on.
      gist.github.com/vectorbread/fac2fcacec189cded8c7cc79e8a4fa50
      For it to work your ground tiles will need a collider for the ray to find.

    • @Rubberduckerino
      @Rubberduckerino 3 года назад

      @@vectorbread OMG thank you now I can finally make a base building game or a train game ive been thinking about thank you!

  • @milodevlogtv4001
    @milodevlogtv4001 2 года назад

    wonderful