I will show you how to use Unity's Tilemap system to create 3D Tilemaps. Kenney's Platformer Kit - kenney.nl/assets/platformer-kit
КОМЕНТАРІ: 208
@theuser8102 роки тому
Simple, yet perfectly to the point! Thank you!
@CELUGames2 роки тому
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!
@absolutewisp2 роки тому
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!
@TheVersionController2 роки тому
Agree.
@TheAsarathРік тому
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.
@eGregiousGames2 роки тому
Love your channel and this video has helped me so much. I love your slow, calm, reassuring style; it's refreshing on UKposts 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!
@pandashrinks013 роки тому
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!! :)
@connorgibes7097 місяців тому
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!
@CabrielUngroid3 місяці тому
Totally agree. I would love to see some more videos on this subject from you. Great work!
@dogo1604Рік тому
One of the best videos i have watched about level design. Thank you.
@JoshWeeksРік тому
Just had to add to the chorus. This is a fantastic and extremely useful tutorial. Much appreciated.
@danielmoreau98222 роки тому
This is fantastic! Exactly what I was hoping to find,
@markb65062 роки тому
Wonderful video. Succinct, easy to understand, and very helpful! Thank you for providing these insights.
@khazlol3 роки тому
Great video! Looking forward to more tutorials. Glad I found the channel :)
@ALZHEM3 місяці тому
Incredible tutorial. One of the best I have ever seen, and I'm not kidding.
@Park_SoYoungРік тому
Thanks to you, I succeeded in making the tilemap.
@Grinwa2 роки тому
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
@vectorbread2 роки тому
Thanks I really appreciate that! Brackeys is one of my favorites as well.
@Grinwa2 роки тому
@@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
@codemonkey55193 роки тому
omg thank you, i dont say this to every tutorial person but i love you
@messiah0012 роки тому
Never subscribed so fast to a channel. Thanks for sharing it with us
@RutherfordMRV2 роки тому
This is fantastic I've got a few ideas for a possible project with this in mind.
@yaelcohen47342 роки тому
this is amazingly helpful!! would love to see a tutorial on how to create a character on this kind of tilemap
@Christian-dd2qm2 роки тому
Finally, a proper tutorial. Thank you.
@lapinranger74052 роки тому
I love you, I needed that, it's very well explained Your video and your voice are well made
@howl2339Рік тому
Your voice is so calming
@usmanarshad8552 роки тому
This is absolutely amazing video to kick start my day 😍
@heliosgames66652 роки тому
I didnt know that was an option in unity! Thank you for the video :)
@perico172 роки тому
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.
@alex.d.warning2 роки тому
the hero we all need
@_kantcРік тому
Thanks
@GeniusBFHРік тому
ty buddy
@wuwuqu3924Рік тому
👍tankyou
@nathamonkongsawat2459Рік тому
Thank you!!! Saved my life from project
@tomasz4848Місяць тому
This is so great, thank you mate!
@seespacelabs60772 роки тому
Very concise and clear. Thanks!
@St0n3dCold2 роки тому
Thanks for the tutorial. I would recommend using different objects for edges and for landmass seperately, to increase performance
@vectorbread2 роки тому
That's a great suggestion! I like that its a simple change which doesn't require any code.
@luizfellipe12062 роки тому
Right to the point! great content, subbed!!
@soekma_aoeliea3 роки тому
Using 2d tool for 3d, Nice! Simple and totally useful for me. Thanks!
@franciscotoro19379 місяців тому
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
@jaycelee84532 роки тому
you have perfect voice for unity tutorial .
@kken87662 роки тому
Good presentation, no bull shit, straight to the point. Thanks Job well done!
@calendulaprox2155Рік тому
Thank you for your knowledge
@twentyonepotatoes079229 днів тому
Great for beginners, Thank you!
@pratyushbarikdev3 роки тому
I think I should explore 2D more. Didn't even know something like this existed. Thanks.
@CulturedxIndie3 роки тому
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
@nietjoost33823 роки тому
I do not need it, but very good tutorial. Good and clear voice!
@YourRelaxingMusicChannel3 роки тому
Thank you!!!!!!! Nice tutorial!
@Michael-qx7rg2 роки тому
Thanks for the tutorial
@GabeJ07Рік тому
clever! thanks for sharing!
@garywilkerson63953 роки тому
This is my favorite youtube video...
@AimedX39 місяців тому
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?
@beanieMp43 місяці тому
LIFESAVER THANK YOU
@dwriedРік тому
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.
@DerClaudius3 роки тому
Thanks, Bread!
@milosancheztv8432Рік тому
this awesome omg !!
@WhiteGemDev8 місяців тому
Strong video, thanks for explaining that. Are you working on a game rn? Keep it up!
@squidyouknow2 роки тому
Thanks so much man
@CheesePizza_GameDevРік тому
straight up man , bada bing bada boom
@franekdomanski72882 роки тому
YOU ARE THE BEST :)
@myibmaccountРік тому
brilliant.
@milodevlogtv4001Рік тому
wonderful
@MrGooGone3 роки тому
bruhhhh thanks so much for making this video. I was about to drop 40 bucks to be able to do this, lol
@tigranavagyan59226 місяців тому
Thank you!!!
@sparrowhawk24193 роки тому
you need more subs
@NguyenHoangPhuong-qf6xb2 роки тому
GENIOUS
@coffeecupstudios5701Рік тому
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Рік тому
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.
@DisturbedNeo9 місяців тому
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.
@coffeecupstudios57019 місяців тому
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.
@yusufhabib35073 роки тому
Thanks 🤗
@ezequielcorrea52402 роки тому
VIDEACOO GRACIAS PAPA
@jakubkadlec42852 роки тому
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
@vectorbread2 роки тому
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.
@LioncatDevStudio3 роки тому
Damn I didn't know about this
@sanogku4745 місяців тому
Great video! got it working in minutes. Additional question, is there a way to programmatically add to the tilemap at runtime?
@vectorbread5 місяців тому
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.
@sanogku4745 місяців тому
@@vectorbread ooh that does work, thanks for the fast response !
@hardsonfinl6859Рік тому
Epic
@diamondgelatoРік тому
very informative and concise video, it was very easy to understand and implement but when i started paintint the tiles unity editor crashed :(
@atamaminami57522 роки тому
Is this capable of autotiling, or are the meshes just overlapping? Thanks for the video!
@niyaziemre85405 місяців тому
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.
@nightcorerelax2560Рік тому
nice
@mediabass3 роки тому
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?
@mediabass3 роки тому
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.
@nether62092 роки тому
@@mediabass that's really good
@seigen93882 роки тому
@@mediabass can you show where is toolbox please? I can't find it
@mejdlocraftci2 роки тому
heh if only I knew this was so easy before I started making my grid system... damn it
@fxy933Рік тому
THANK U
@vectorbreadРік тому
Thank you! :D
@ramonsohal24043 роки тому
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?
@vectorbread3 роки тому
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.
@ramonsohal24042 роки тому
@@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!
@Laktostolerant2 роки тому
I love you
@Vii13_Рік тому
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Рік тому
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_Рік тому
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 !
@McPatooМісяць тому
Holy duck, i was really wasting my time doing a level with probuilder, this looks better :D
@jeffreyjumisko51652 роки тому
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.
@vectorbread2 роки тому
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.
@jeffreyjumisko51652 роки тому
@@vectorbread Thank you for responding to my question. This tutorial is really helpful for relatively new game designers!
@oldborodach2 роки тому
👍🔥🤝
@sagitswag17852 роки тому
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?
@vectorbread2 роки тому
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.
@miladh87492 роки тому
Hey, thanks for the video!!!! Is this also able with hexgrids?
@vectorbread2 роки тому
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.
@miladh87492 роки тому
@@vectorbread Thank you! Now it works :)
@FC-BS2 місяці тому
how do you switch to game object brush? unity isn't allowing me to
@diogoico2 роки тому
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...
@vectorbread2 роки тому
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.
@diogoico2 роки тому
@@vectorbread Ohh I get it now so that is how it is... Thank you a lot for your help!
@DarkoddishРік тому
@@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
@JDee062 місяці тому
Is it possible that I can place in-game gameobjects like roads on the tiles?
@SwitchZettoРік тому
That's interesting! Is it as optimised as 2D tiles?
@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.
@DocdoozerРік тому
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Рік тому
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
@noobcola3 місяці тому
@@vectorbread I was just about to ask the same thing! Thank you for sharing that script!
@foresight9688Рік тому
Does the 3d tilemap allow something similar to a composite collider,having loads of 3d colliders seems memory intensive
@vectorbreadРік тому
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.
@phatly10 місяців тому
with tilemap, which collider should be used? It's won't work with tilemap collider 2d
@vectorbread10 місяців тому
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.
@kannpai3 роки тому
Can you do multiple floors? Any way to 9-slice it like in 2D if so?
@vectorbread3 роки тому
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.
@DahaiLi4 місяці тому
2 years later, it's still hot dog water
@enbermudas42692 роки тому
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?
@enbermudas42692 роки тому
Also, can I use the grid to create some sort of tactical movement or is it just to paint?
@vectorbread2 роки тому
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).
@abdou0232 роки тому
Can you add custom data to these object and manipulate them after painting?
@vectorbread2 роки тому
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.
@OverAndOverAndOverРік тому
Is there a way to make this procedural?
@iR3dyOfficial9 місяців тому
Is there a more efficient way to add mutliple levels vs adding new tilemaps for every tier?
@vectorbread9 місяців тому
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.
@argtorrРік тому
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Рік тому
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.
@Brolygaming9992 роки тому
Is your channel, Becuz i see ads is start and end , or just the UKposts new rules
@vectorbread2 роки тому
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 UKposts'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.
@Brolygaming9992 роки тому
@@vectorbread New Rule sucks , Bruh
@miguelangeltagliola6559Рік тому
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Рік тому
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.
@miguelangeltagliola6559Рік тому
@@vectorbread thks
@ceren52522 роки тому
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 :(((
@vectorbread2 роки тому
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.
@j_ordinary4252Рік тому
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Рік тому
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.
@gabryelhuneault1801Рік тому
For some reason the package manger button isn't visible in the window. HELP PlEASE!
@vectorbreadРік тому
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
@waiissac13192 роки тому
Can u rotate the game objects on the tilemap? How to do it?
@vectorbread2 роки тому
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.
@mr.creature12522 дні тому
I have been f*cked up in making a tiled map for my 3D Pac Man game by making it manualy before I understand what tilemap is😂