3D Grid Building System - Unity Tutorial | City Builder, RTS, Factorio

Поделиться
HTML-код
  • Опубликовано: 19 дек 2024

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

  • @TamaraMakesGames
    @TamaraMakesGames  2 года назад +14

    In what game would you use this system?

    • @laudh
      @laudh 2 года назад +4

      In some clone of Dofus,
      have you ever played it ?🤔

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

      @@laudh I haven't, but I looked it up and it seems interesting

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

      In mobile tower defense game inspired with Power Towers TD from warcraft3.

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

      Is it possible to make a real time PvP player based on this kind of tile maps?

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

      @@aoboard In my opinion, this system is independent of any other parts of the game so you can build any game you want with it.

  • @Bdarkan
    @Bdarkan 9 месяцев назад +7

    I really like your tutorials! I also wish they were more patient with the viewer! Like @6:56 there's barely a moment between the finished line of code and moving onto the next one. Links to previous videos when that information is presented would be helpful too. I got so confused in the first part when the white tile suddenly appeared. I took your advice and looked at the Unity API and found the answer. It'd be super helpful in the future to have links or annotations for anything related to the video but not covered in it!

  • @NightEver
    @NightEver Год назад +7

    Hi, my system is not working like it shows on 8:16 of the video. Someone know why it could be??

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

    Hi, at 12:15 and in other points throughout the video, I really don't understand what is going on with these "v:Vector3Int"s and "x:" as I use Visual Studio Code and it doesn't seem to have this. If someone could explain as it's giving me errors when I add these and also when I remove them. Can someone help? It's a bit frustrating as I have no idea what the visual studio code equivalent to "v:" is.
    Edit, these are called IDEs and in "v:Vector3Int", u just ignore the Vector3Int and type "var v in ..."

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

    Currently making a RTS game where there is a builder unit that can build things. I'm also watching a video about building nav meshes in realtime so that the units can easily move around the buildings. Thank you a lot for the video!

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

      Interesting, good luck with your project! I'm glad that you liked the video :-)

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

      hey if you havent figured this out yet
      you shouldn't use nav meshes for an rts try searching A* pathfinding and flowfeild pathfinding
      they are much faster for performance
      and with flowfeild you could have selected troops all follow a point only needing caculations for naviagation once instead of 20 -30 times that nav meshes would do

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

      @Spectrum 13 there is a code to find all navpaths for each agent. And once calculation is finished, run all paths ant once so all agents move at the same time

  • @bigfattaco7321
    @bigfattaco7321 2 года назад +5

    Hello! I tried following the tutorial but however, I'm having some issues with the object drag. It doesn't function the same when I tried to drag my cube around. Not sure what is the problem.

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

      Hello! You can ask about this on my discord server and provide more details. Maybe someone might help you, there is an amazing gamedev community there. Link - discord.gg/dCJBpe2meg
      Object drag is not the main part of the system so if something doesn't work you can write your own object drag that works for your project

  • @alir8zana635
    @alir8zana635 2 года назад +6

    Great video
    Your content is getting better and better
    Keep up the great work 👌

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

    Thank you for this amazing tutorial! This helped me a lot.
    I found a bug(?) at 13:02, you correct `area.size = new Vector3Int(area.size.x + 1, area.size.y + 1, area.size.z);` but it should actually be `area.size = new Vector3Int(placeableObject.Size.x + 1, placeableObject.Size.y + 1, placeableObject.Size.z);`, otherwise size will always be (1, 1, 0) as area is just initialized two lines above? Swapping to placeableObject.Size worked fine for me on preventing from placing an object on taken area.

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

      Hi, glad you liked the tutorial!
      As for your bug report, there should be a line just above the one you mentioned where I assign the Placeable Object's area to the area size. And then I add 1 to each coordinate. But you're right, it would have been better to do this right away as you suggested. Nice catch 😉

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

      @@TamaraMakesGames Thanks for your reply! Ahhh I see! I totally misunderstood what you said! not swapping but re-assgining "area.size" to area! My bad😅

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

      This comment fixed my problem thank you!

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

    This is sweet! Thanks for this Tamara!

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

    Im confused. We code A and B to place prefabs, but what is Spacebar doing?
    I can place items, but they stack ontop of each other and disregard anything. Also no white tiles are being created when I place anything.

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

      A and B are for getting the objects. The spacebar is for actually placing them. You'd want to change these inputs to something like buttons on the screen in your game.
      As for the placing issue, look through the CheckPlacement method. Also, make sure that you're actually triggering the placement (pressing the spacebar). If you haven't done that the buildings might have just stacked on each other each time you pressed A or B.

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

      Make sure you added the placeable object script to your prefab

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

    Hi! Great video
    Why at about 14:30 you manually paint this "boundary box" saying that it is needed to work correctly? I don't get it :(

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

      Hi! Thanks!
      So the reason I do this is because when we're calling the method to paint a block of tiles it compresses the boundaries of a tilemaps to the minimum. The painting will simply not work outside that box. So if you don't have any tiles on the tilemaps it won't paint anything at all

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

    I needed to know how to snap co ords in grid for personal proj , Thanks!!!

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

    Thanks for another awesome video! Hope you're staying safe!

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

      I'm super glad that you liked it! And thanks, I am trying to stay safe

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

      @@TamaraMakesGames Glad to hear! One recommendation I have is that when you reference your older videos that contain necessary skills, is it possible to place a clickable link to that video on yours? No worries if not, its very easy to just click and see what one you meant :)

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

      You make a valid point. I usually include links in the tips that are shown at the top right. But I guess I might have missed them in this one. Thanks for telling me

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

      @@TamaraMakesGames thanks for helping me with this tutorial!!

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

    Hey, great tutorial!
    I just had one question tho, is it also possible to make it so that let's say I am using this to decorate the inside of an house. To place things on tables and such? Like an object that has an elevation. (take PewDiePie sim for example, there you can place a table and then place other objects on that table but also on the ground, it just elevates on top of the object. Although in my case the tables are already there, I just need to place objects on it or on the floor)

  • @lawlessgames3844
    @lawlessgames3844 2 года назад +4

    Great job. Really high quality tutorial

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

    5:08 for me on line 18 it is giving the error of Error:The type or namespace name 'PlaceableObject' could not be found (are you missing a using directive or an assembly reference?) with Code:CS0246
    any ideas/suggestions?

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

      Create the script PlaceableObject and make sure it is in the same namespace as your other scripts

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

      @@TamaraMakesGames ok so the problem was it put: public class NewBehaviourScript : MonoBehaviour
      not: public class public class PlaceableObject: MonoBehaviour in PlaceableObject.cs.

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

    This grid building was an absolutely amazing base for me! Thank you so much!!

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

    Tus videos son de increíble ayuda, greetings from Spain!

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

      Thank you! I am glad that you like the videos! Greetings from Ukraine

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

    Hi Tamara, very good tutorial. But I have a problem when I try to move the object, where when moved with the mouse, the object returns to where it was spawned. Does anyone have the same problem as me?

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

      Hi! Thanks!
      Check the grid snapping, maybe there is an error. Maybe the delta distance is calculated wrong so it snaps to the same position. And check if the coordinate conversions are correct (screen to world)

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

    Спасибі за туторіал, саме те що потрібно для моє гри симулятора трубопроводчика)

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

      Будь ласка! Рада що туторіал був вам корисним!

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

    Great video! I'm wondering if it would be possible to have more than one collider? for example having an L-shaped building and needing two colliders for that, how would that work?

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

    Discovered you today, very clear and precise instructions. A great addition to the community of game developers. Respects and love from Pakistan

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

      I am delighted to read this! Thank you for your kind words! Greetings from Ukraine

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

      @@TamaraMakesGames hey, my prayers are with Ukraine and it's innocent citizens. May things get better soon for you my friend.

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

    thank you tamara, nice video !!!

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

    Hii, nice video, thanks for the tutorial, I have an issue and I've seen a few comments and threats on the Discord server with the same issue, all works correctly BUT the function to know if the cell is empty or not (CanBePlaced()) seems to return always true, because of that, I can Place buildings over buildings infinitely, some help with that?¿

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

    Hello, I have a plane and its type is a cargo plane. I want to make a grid system for this with 3 different short side and long side dimensions. Do you think this video will help with this? Can it be converted to the shape I want?

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

      Hi, I think yes, this video can help you. The system works with buildings that are not just squares. You just have to stretch the box collider and be careful to not mix up the coordinates when calculating the building size. and if you were talking about the shape of the building field itself, that can be achieved too. You would just need to define the borders of the available area by painting white tiles (the taken tiles).

  • @Wiviart_
    @Wiviart_ 7 месяцев назад

    Hi Tamara, I really love your video. But the time is long and something have been changed. I followed your tutorial but I stucked from Part 2: Building Placement. My grid is not fill right with prefab and I can build a lot of prefab in 1 cell. Can you review your code for any update to fix those bugs?

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

    Hey Tamara, I thought this was a great tutorial, but I'm just having one problem. I'm getting the error "Object reference not set to an instance of an object - PlaceableObject.GetStartPosition" I'm not sure how to fix this, but it is probably because I didn't really know what you filled into the CalculateSizeInCells method as you skipped over it a bit, but if you could try to help, that would be great! Lots of love from Ireland :)

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

      Hey, there! I would like to help you but I need more information on the issue you're having. Just share the line of code that's giving you the error - I assume it is somewhere in the GetStartPosition method.
      Also, I would appreciate if you do it in my Discord server (channel help) - discord.gg/dCJBpe2meg
      And cheers from Ukraine 🇺🇦

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

      @@TamaraMakesGames I’ll join the discord now, and thanks for the incredibly quick response :D

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

      I just happened to be answering the comments

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

    Hello maam.
    Do you have a simple sitting on chair tutorial?Like there will be an arrow on top chair and when you click it you will sit on chair.
    Thank you sir.

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

    An amazing video, and with not too much effort as well! However, I noticed these one or two "main" issues while I was trying to implement this myself. I've checked and everything seems to be the same as the video, but it just doesn't seem to work.
    When I try to *place an object that is larger than 1 square unit size* (e.g. an object that is 3x3 units), the white tiles appear, but instead of filling the entire 3x3 area, *only one tile appears at the corner* , while the other 8 tiles that it should occupy remains empty.
    Also, another problem (Maybe related to the top problem but unsure), *after placing the object, I can place another in the exact same area* , and it seems like the CanBePlaced method doesn't really work as intended, or just keeps returning true and never false.
    I would appreciate any help on this. Thanks!

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

      Hello! Thank you, I'm glad you liked the video. As for the issues, the first one to do is to check what positions are in your area and if they are correct. Also, check if the size detection works well. One of my guesses is that your tilemap can have small bounds. Make sure that you placed a border of tiles around the area.
      Considering the second issue, it must be something wrong with positions so check those.
      I recommend doing some debugging and really getting inside of your code. If you still continue having issues, come up to my Discord server, maybe we'll solve these issues all together. Link to join - discord.gg/dCJBpe2meg

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

      ​@@TamaraMakesGames Thank you so much, i was having the same problem. great tutorial.

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

    This is a great channel, informative and top tutorials

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

    go you dude love what ya doing

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

    What if instead of selecting a prefab with a keyboard key, i want to select the prefab from a menu with my cursor? how would i implement that into my code?

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

    Is it possible to integrate this with the custom tilemap brush?

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

    hello can you help i finished the code but it give me error Assets\scripts\BuildingSystem.cs(18,13): error CS0246: The type or namespace name 'PlaceableObject' could not be found (are you missing a using directive or an assembly reference?)
    do you know anyway on how to fix this?

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

      Hi, did you create the script PlaceableObject? Make sure you didn't make any typos in the class declaration

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

      @@TamaraMakesGames yea made the script added it to prefabs and I checked nothing wrong

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

      I have the same issue atm

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

      I have solved the issue by deleting the script PlaceableObject and recreating it. Now the script BuildingSystem is functioning as intended.

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

    Do you think this style of grid control would work with a hex grid?

  • @k1ng.Gaming
    @k1ng.Gaming 2 года назад +1

    so if I place the object only one tile appears and if I destroy the object that one tile doesnt go away! please someone help me! greet tutorial btw!

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

      You need to do some debugging and provide me with more information to solve this issue. Perhaps use my discord server for this - discord.gg/dCJBpe2meg
      And thanks, I'm glad you liked the tutorial!

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

    I love you Tamara 🥰🤗thanks for amazing tutorial.

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

    Hi Tamara, thanks for all these tutorials, they are helping me in my project. I was working on the Building System script, but then I type private PlaceableObject, it is not recognize, do you know why could be the reason?

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

      Hi there! I'm glad you liked my tutorials. As for your issue, make sure you have created the class placeable object and you don't have typos in its name.

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

      @@TamaraMakesGames Now, it makes sense now, I didnt create the placeableObject script file, now it's working, thank you

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

      you have to create the script at first

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

    Hi i love your Tutorials. But right now im having a Problem with your example. To get the Tilesinformation you iterate over area.allPositionsWithin in class GetTilesBlock(). i have copied it exactly and it doesn't go into the foreach loop. i've tested the area param, but it contains data.
    private static TileBase[] GetTilesBlock(BoundsInt area, Tilemap tilemap)
    {
    Debug.Log("area contain data: " + area.allPositionsWithin.GetEnumerator().Current);
    TileBase[] array = new TileBase[area.size.x * area.size.y * area.size.z];
    int counter = 0;
    foreach (var v in area.allPositionsWithin)
    {
    Vector3Int pos = new Vector3Int(v.x, v.y, 0);
    array[counter] = tilemap.GetTile(pos);
    counter++;
    Debug.Log("data of variable: " + v);
    }
    return array;
    }
    Are u able to help me out :D Thanks so much!!

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

      Hello! That is definitely an unexpected behavior. Your code is perfectly fine so maybe the problem is elsewhere. Try to do some debugging and check the size of your area.

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

      I think you have to switch from `area.size = new Vector3Int(area.size.x + 1, area.size.y + 1, area.size.z);` to `area.size = new Vector3Int(placeableObject.Size.x + 1, placeableObject.Size.y + 1, placeableObject.Size.z);` in CanBePlaced funciton. I am not sure what issue you have but in my case, I could place an object on area where is already taken by others. If you have the same issue, switching area.size to placeableObject.Size would solve it.

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

    Hello, I have some problems with the system, when I drag them on the scene the collision with others building is not detected so I can place 2 buildings in the same position. How can I fix that?

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

      Hello! This system is not based on collisions it checks the area under buildings. Check if your building sizes are correct and also the method that checks for the area availability

  • @David-lz4fj
    @David-lz4fj Год назад

    Hello, I've been pulling my hair our and hoping you can help. I followed the Tutorial and it worked great! except when I try to implement a system to delete an object that was placed, i can get the object to delete but I cant for the life of me get the tile to change from the white tile. please help, anyone

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

      Hi! To remove a tile from the tilemap you would have to set the tile at that position to null. A common issue is the position that you're passing into the SetTile function. Check if the coordinates are correct. If you have successfully set tiles when placing a building then you can modify that code to set the tile to null.

    • @David-lz4fj
      @David-lz4fj Год назад

      It places the white tile and building just fine, i can even get it to remove the object, but the tile stays white no matter what i do. @@TamaraMakesGames

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

    Hey @Tamara Make Game. Wonderful tutorial. I had a problem but I found a solution. Your tutorial gave me a headstart

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

      It should be Vertices with the capital V. I'm pretty sure that's what's causing the error. Another person had this issue and posted it on my Discord discord.gg/dCJBpe2meg

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

      @@TamaraMakesGames the problem was the declaration. I fixed it by using [] instead of () that I used before. Thank you so much for your response

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

    Hi Tamara, Amazing Video, But in my case everything works fine but the *objet isnt filling the tilemap exactly* (Actually its filling upper area from TilemapGrid) so CAnbePlaced always return as true(cuz tiles painting wrong),, when i paint manuallly its return false;
    Help Me Please, Love From Sri Lanka

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

      Hey there! Thank you! And as for your question, try understanding why the position is not correct. One of the reasons is that you moved the tilemap object or the camera and now the positions are shifted. I recommend debugging and seeing the positions or, a more visual method, try making a method that fills up one tile on your mouse click. It'll help you better understand. You can also place a tile at the zero position and see where it is. Hope that helps! Greetings from Ukraine 👋🇺🇦

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

      @@TamaraMakesGames Thanks For Your Fast Reply , I've Modified the Code My Own Way and now its functioning properly,
      It's Sad to hear Tht You are From Ukraine, What is the situation on ur area 😪🤐 Praying for Ukraine 🙏

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

      Glad to hear that you fixed things! And thank you for the support. You can join my Discord to find out more about my current situation - discord.gg/dCJBpe2meg

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

    Hey Tamara, it looks like it doesn't work when there's only 1 tile sized object, it's placing it there and event filling it, but detecting the tile using the "CanBePlaced" doesn't work for me, does it work for you?

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

      I mentioned in the video that the size has to be increased by 1 on both axes because when it is calculated it is smaller. Try debugging and see if the size is actually 1 and not 0

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

    Can you do a tutorial on how to "save" a grid (as an array or JSON) and load it later? So players can save their game?

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

      Thank you for the suggestion. I'll think about making such video.

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

    Hello :) How would I go about allowing the building to follow the mouse until I place it down? Im having trouble with using Left Mouse to click on UI to Initilize the Build as well. Thanks!!

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

      Hey there! Following the mouse would be easy, just get the mouse position in the update method, perform some raycasting like I did in this tutorial to get the world position, and assign the new position to the transform of an object you want to move. As for the left mouse clicks, I can't really help with that, but I suggest you try asking in my discord server, maybe somebody there knows. Link to join - discord.com/invite/dCJBpe2meg

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

      @@TamaraMakesGames Thanks for the quick reply :) Ill stop by the discord for sure!

  • @ord-a28
    @ord-a28 2 года назад

    how can i set that the building will spawn at my mouse position after i clicked a button or pressed a key??

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

      Hi there! You have to modify the initialize with building method in the grid building script. Instead of vector3 zero pass the mouse position in world space

    • @ord-a28
      @ord-a28 2 года назад

      @@TamaraMakesGames I tried something and changed so that the object spawns on the the mousePosition but not on my terrain, it spawns on the canvas
      My Code:
      public Vector3 SnapCoordinateToGrid(Vector3 position)
      {
      Vector3Int cellPos = gridLayout.WorldToCell(position);
      position = grid.GetCellCenterWorld(cellPos);
      return position;
      }
      #endregion
      #region Building Placement
      public void InitializeWithObject(GameObject prefab)
      {
      Vector3 mousePos = Input.mousePosition;
      GameObject obj = Instantiate(prefab, mousePos, Quaternion.identity);
      objectToPlace = obj.GetComponent();
      obj.AddComponent();
      }

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

    I really need the 2d version for this?
    excluding the codemonkeys one, i cant find it anywhere

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

      2D version of this tutorial made by me - ruclips.net/video/gFpmJtO0NT4/видео.html

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

    Hello, thank you for the video it really helped me but I have a question. When we destroy the prefab using echap, the white tiles don't disapear. How can we erase them ?

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

      Hi there! I'm glad you found my video helpful.
      I think you're not calling the erase method after destroying a building. In the building system script should be a method for clearing tiles on some territory.

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

    What if there is a wall and you place something on wall? it use y and z axis ?

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

      Depends on how your axes are rotated and which wall it is. If your y axis points upward your coordinates can be on x and y on one wall, and y and z on the other wall.

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

      ​@@TamaraMakesGames thank you, you are great.

  • @ord-a28
    @ord-a28 2 года назад

    I tried something and changed so that the object spawns on the the mousePosition but not on my terrain, it spawns on the canvas. How can i fix it?
    My Code:
    public Vector3 SnapCoordinateToGrid(Vector3 position)
    {
    Vector3Int cellPos = gridLayout.WorldToCell(position);
    position = grid.GetCellCenterWorld(cellPos);
    return position;
    }
    #endregion
    #region Building Placement
    public void InitializeWithObject(GameObject prefab)
    {
    Vector3 mousePos = Input.mousePosition;
    GameObject obj = Instantiate(prefab, mousePos, Quaternion.identity);
    objectToPlace = obj.GetComponent();
    obj.AddComponent();
    }

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

      You didn't convert your mouse position to world point. And it is better done with ray casting in 3d. I featured this function in the grid building script

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

    Привет Тамара! Спасибо за видео!

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

    My prefabs are instantiating at a fixed position always and not at the point where i click

    • @corentinbajdek6391
      @corentinbajdek6391 7 месяцев назад

      That's actually expected behavior.
      You have to click on your prefab (triggering OnMouseDown) and drag it (Triggering OnMouseDrag) to drag it to the desired position.

  • @ord-a28
    @ord-a28 2 года назад

    İ wanted to remake this script, but İ get an error by "[SerialzeField] private Tilemap MainTilemap", its saying that Tilemap can't be found, how can İ fix it

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

      Did you import the tilemap package into your project?

    • @ord-a28
      @ord-a28 2 года назад

      @@TamaraMakesGames İ imported 2D Tilemap Editor, did İ have to import other packages?

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

      @@ord-a28 That should be enough. You have to import tilemaps in the script where you're using them. Like this
      using UnityEngine.Tilemaps;

    • @ord-a28
      @ord-a28 2 года назад

      @@TamaraMakesGames İt worked, thank you.

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

    Hi tamara are you starting from scratch ?

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

      Hi, there! Yes, in this tutorial I am using a new project, it's not part of a series

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

      @@TamaraMakesGames thank you

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

    Great video!

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

    Nice video :) How do we make irregular grids? Would it be possible to create a realistic cadastre map?

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

      Hi there! Thank you!
      As of such maps, this particular system can't do that because it is based on the Unity tilemaps which don't have such option. But it is a very interesting topic so maybe I'll look into it 🙂

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

    Where can we get White Tile file?

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

    do not follow this tutorial. There are newer method which support more. Watching this will not waste your time though, you will learn how to configure unity even if it do not help you for this task.

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

    Day 1 in the life of a senior game developer

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

    What's the 'Grid.cs'

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

      A Unity class that has the methods to convert coordinates from world space to grid cells

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

    Drag working fine but not spacebar thing. Esc working fine.

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

    Maybe next time don't skip some isntructions like how to create a tile from a sprite, it's just appearing like that for you but for beginners it was a nightmare to figure what it was

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

    you are aweesomee!!

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

    Nice video!

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

    Hi Tamara, How are you, I suggest you make a series of RTS games, knowing that there is no content on RUclips to prepare a course for it. Even if it is paid, I will buy it to support you. I hope you will fulfill my request and be 3D

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

      Hey there! Thank you for your suggestion I will definitely take it into consideration. If I were to make such tutorial series, what features are you interested in?

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

    Good job

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

    Where is Placeable Obj code?

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

    I think i love you :D fantastic !

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

    Great video and code Tamara, I am a Patrone sponsor! One thing, I do not know if I made anything wrong but when I place a house/object I color the tiles but when I then move it those colored tiles remain. Another thing, the second time I place an object it cannot be moved anymore (after first placement I can move it one more time), last thing, when I move an object it does not become the current object so when I rotate it then another object rotates instead. What can I do?

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

      Hello, please reach out to me on Patreon or even better on my Discord server in a dedicated patrons channel and I'll try to help you

  • @user-em9su3dd9y
    @user-em9su3dd9y 2 года назад

    Nice!

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

    You shouldn't name both private variables and public properties with CamelCase. Private should start with _or something else otherwise it's way too hard to debug. You'll thank yourself later

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

    Hi!)
    You have very cool videos.
    I wish I could subscribe to patreon(
    Is there any other way I can pay for my subscription and get access?)

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

    Kool

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

    can you please help me for a project?

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

      If you're talking about a freelance offer, I don't take those at the moment. If you just want to get help implementing t he system in your project you can come up to my Discord server - discord.gg/dCJBpe2meg

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

      @@TamaraMakesGamesWe can met on wat app because discord have problem don't work and im not undestand if i need pay you if you doing as job programming cs?

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

      I am not taking such jobs at the moment

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

      Can you givme facebook or Wat app so i can send project discod dont work me

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

    I love you

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

    Unity now supports 2d and ar and all kinds of other things so we don't use unity3d as a term anymore really lol
    it's just unity now lol

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

      Emphasis was on 3D since this is a grid building system for 3D projects in Unity

  • @diplextutounity3d35
    @diplextutounity3d35 2 года назад +12

    your tutorials are much too fast and suddenly we do not understand

  • @ScottRichards-eu1of
    @ScottRichards-eu1of 7 месяцев назад

    I'm sure everything I wanted to know was there, but you went way too fast for a tutorial.

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

    idk but its not working

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

    I didn't understand shit

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

    Unity grid system not god at all. I suggest you to write your own.

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

      A lot of people think so but it's actually very helpfull if you know how to use it 🙂

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

    The hardest tutorial videos I've ever watched in my life are yours, the code structure is already bad and you explain very incompletely as if you bought the codes from someone else and didn't write them yourself.

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

    Very good tutorial, but are you looking for a husband?

  • @darrenj.griffiths9507
    @darrenj.griffiths9507 2 года назад

    You are fit! lol

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

    Are you single? :)

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

    Instagram?

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

      I am not on Instagram. I have a discord server though. Here is a link to join - discord.gg/dCJBpe2meg

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

      @@TamaraMakesGames Joined 😊