RANDOM MAP GENERATOR - EASY UNITY TUTORIAL

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024

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

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

    I didn't belive you could explain spawning random elements in 7 minutes, but you nailed it. Great job!

  • @bunggo9914
    @bunggo9914 6 ปีที่แล้ว +66

    wow, I think making a randomly generated level in a game will take a long time... well you have changed my mind!

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +10

      Exactly, it can in fact be very easy :) !

  • @llawx4865
    @llawx4865 6 ปีที่แล้ว +161

    The way you explain things makes me want to learn lol

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

      how can i reference all the objects at once?

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

      @@waffwrw array or create empty then use GetChild() function

  • @ChillinGames
    @ChillinGames 6 ปีที่แล้ว +24

    if you want to add an animation to your prefabs that effects positions (tree blowing in the wind, plant wiggles when you collide with it), you will have to make the instantiation a child of the spawn point:
    GameObject currProp = Instantiate(_prop[rando], transform.position, Quaternion.identity);
    currProp.GetComponent().parent = transform;

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

      yep but you need more of the big brain that I dont have

  • @theonerm2
    @theonerm2 5 ปีที่แล้ว +2

    This is so easy to do and I can do so many things with it. I felt a little overwhelmed and lost when it came to actually making the levels. There are so many different elements to a level and having to decide every little thing myself is time consuming. Being able to randomly generate parts of a level while having this kind of control is such a good thing. I love it and I'm going to use this in my game.

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

    Man ever tutorial you release is absolutely on point, clear and to the point. Keep it up dude!

  • @Luis-Torres
    @Luis-Torres 6 ปีที่แล้ว +6

    This is such a simple way of doing it I love it! Great for beginners who are interested in Procedural generation!

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

    Yup, this video deserves a like for me to check over and over again to learn and manipulate these methods. Absolutely fantastic explaining.

  • @JohnWeland
    @JohnWeland 6 ปีที่แล้ว +15

    I'd love to see a way to do this while having biomes that can run into each other while feeling natural. e.g. a pine forest would have more pine trees that a deciduous forest of a grassy plans area, etc so you could have a large level with different areas each area type uses assets specific to that area type. couple this with your random dungeon generator mini-series and you got something truly awesome.
    A random world with unique areas that have dungeons in them that are also unique but also feel like the fit the area.

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

      oh and 'seed' generation so you could recall a given map by using its seed.

  • @EDGYTML
    @EDGYTML 6 ปีที่แล้ว +10

    I don't know if i should call you a genius or a game project savior , you are the best my man ❤

  • @zirizo
    @zirizo 5 ปีที่แล้ว +15

    1:35 the beginning

  • @dumonyu5027
    @dumonyu5027 6 ปีที่แล้ว +1

    I've watched a few of your videos so far, but you earned a sub with this video. Great intro for beginners to what can be a complicated subject. Keep up the great work!

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

    This concept is going to totally revolutionize my 2D open world game, thanks!

  • @Max29847
    @Max29847 4 ปีที่แล้ว +125

    This guy sounds like he wants me to enter his free gift card giveaway

    • @jmoll5165
      @jmoll5165 4 ปีที่แล้ว +2

      Stop offending the guys voice

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

      @@jmoll5165 owh c'mon you gotta admit thats funny and somewhat true

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

      @@peeei7423 ok fair enough but like still

  • @joshuamekeel4975
    @joshuamekeel4975 5 ปีที่แล้ว +6

    If you want to make more of a random feel you can add another random variable and if it returns the correct number then it will spawn a random object at that point (here is the code i used):
    {
    public GameObject[] objects;
    //This is the variable determining if thing is spawn (asteroids in my case)
    public int randAsteroid;
    void Start(){
    //The variable is being assigned a random int either 1 or 2
    int randAsteroid = Random.Range(1,2);
    //If the variable is equal to 1 then an asteroid will be spawned in this place
    if(randAsteroid == 1){
    int rand = Random.Range(1, 3);
    Instantiate(objects[rand], transform.position, Quaternion.identity);
    }
    }
    }

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

    You really are a goddamn blessing to an indie Dev who's very time limited

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

    SUPER HELPFUL, thanks for the video. I'm participating in a game jam, so this helped a lot.

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

    This helped me out so much on the game I was working on!
    It's so simple and You can also use it to spawn enemies!

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

    Make sure to prefab! I was struck at not being able to drag and drop into my array as done at 4:15. I had to make the array of type Sprite[] instead of Gameobject[] but when the sprites were prefabed, it wold work like in the video
    Thank you for the tutorial !

  • @LERPish
    @LERPish 6 ปีที่แล้ว +11

    Quick easy well explained and usefull congrats for another great video

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว

      Thanks :) ! Those sort of comments are fabulous to read !

  • @mewo-mewo-3o-3o
    @mewo-mewo-3o-3o 6 ปีที่แล้ว +3

    Ur channel is amazing you make me excited about video games, and i like your art style keep it up

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

    Bro, thats insane how easy and versatile this simple C# script is.

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

    I used this to make random resrouces objects generate in random postions in my RTS project scene, great stuff, thanks for the video

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

    it spawned on some where else when i did it so i made this lines to make it work
    " public GameObject[] objects;
    public Transform spawnpoint;
    private void Start()
    {
    int rand = Random.Range(0, objects.Length);
    Instantiate(objects[rand] , spawnpoint.position, Quaternion.identity);
    }"

  • @themightyjinglesaj2522
    @themightyjinglesaj2522 6 ปีที่แล้ว

    Brilliant. Please continue with ur way of teaching. You are a brilliant teacher. Thank you teacher. Keep it up.

  • @Dailyfiver
    @Dailyfiver 5 ปีที่แล้ว +1

    Your channel is always so beginner friendly and helpful. Thanks you!

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

    I love the art style. It reminds me of castle crashers

  • @andresparrow91
    @andresparrow91 6 ปีที่แล้ว +2

    Thank you so much for putting your time and effort to teach people. Keep up the good work!

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

    Best video so short just as I like it keep up the good work!

  • @umsfmercenary3910
    @umsfmercenary3910 4 ปีที่แล้ว +1

    I do not have Unity. Currently, I have blender 2.8 and Buildbox 3. I have a need of a way to generate a large map with separated areas each with their natural assigned objects such as plains with grass, deserts with sand and dunes and rocks, wide valleys with rivers, mountains and plains with trees, cliff- focused canyons and other things, as well as specific objects and assets atttuned to each separated area. How do I generate a landscape that automatically applies competent pathways and objects as well as the terrain itself? Also, is it possible to force rivers and creeks and streams to generate from an asset that is designated to a specific seperated area and apply a height range?

  • @TheGamingWiccan
    @TheGamingWiccan 4 ปีที่แล้ว +10

    how would i add infinite procedurally generated terrain to this system?

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

      well i guess you could make it so it keeps randomly creating the onto the player

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

      CodeMonkey did a video on subscenes. It will be of help: th-cam.com/video/91kJtsDLTyE/w-d-xo.html .

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

      how can i reference all the objects at once?

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

      @@waffwrw Add tags to them so that you can find them by referencing the tag for example. You could also just parent them to a specific gameobject and pool them that way.

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

      @@oatcube3961tags are never the best option, but they are the easiest and since this tutorial is for beginners I guess they are all right but singletons or scriptable objects would be better to reference them all.

  • @Misttxd
    @Misttxd 7 หลายเดือนก่อน +1

    Hello love the tutorial, but I need your help here. I have attached a script to each of the prefabs that are being generated but the script has some references. is there a way how to fill those references with script so I dont have to manually put them into every spawned object because that woud just not be right :D.

  • @SkySentry7
    @SkySentry7 4 ปีที่แล้ว +1

    I like the way you teach.........its Phenomenal!

  • @cptray-steam
    @cptray-steam 3 ปีที่แล้ว +1

    Wow that was way easier than I thought it would be. This can be easily expanded as well to make the template objects spawn randomly in world space, in theory. Create a new script and call it GenerateRandomTemplates or something else for that matter. Then add an array of those template game objects, and after that an random random int from 0 (world origin) to the max distance you want it to spawn these objects. Tell it to instantiate the template prefabs every few dozen world points with that random int being the point at which it spawns, then wallah. Should work, I'll have to test it though, but um...
    Or instead of using an int you can use a vec3 (for 3D games) or vec2 (for 2D games) with a random int for each vec value (x, y, z). It will randomly place those templates at the given random point. Just don't go too crazy with it. Lol. And remember to set the objects that don't move as static! Otherwise (depending on how many templates are spawned) it would get real laggy, really frickin' quick.

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

    Scaleable awesomeness. Great method and thanks for sharing.

  • @tapendrashahi2097
    @tapendrashahi2097 6 ปีที่แล้ว +2

    I really love your background music : )

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

    Damn you explain a way it's so cool. Thanks

  • @zogoloov4313
    @zogoloov4313 4 ปีที่แล้ว +1

    your voice is awesome bro thank you so much

  • @YnIanIo
    @YnIanIo 5 ปีที่แล้ว +9

    BTP, is there a way to randomize the spawning of the spawnpoints' position themselves?

    • @rzezucha7327
      @rzezucha7327 5 ปีที่แล้ว +10

      Vector3 Spawnpoint = new Vector3(Random.Range(lowest, highest+1), Random.Range(lowest, highest+1), 0)
      Instantiate(YourObject, Spawnpoint)

    • @raik1766
      @raik1766 4 ปีที่แล้ว

      @@rzezucha7327 also, i would do that in a function and then check if it colides with any other spawnpoint then delete it and repeat the function

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

      @@raik1766 Put a trigger collider in them and in the code just destroy it if is colliding with another spawnpoint

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

      not that i know of, but you can randomize how the thing spawns

  • @MrSpiky
    @MrSpiky 5 ปีที่แล้ว

    I watch your videos to learn but do enjoy them anyways! Keep up the good work bro

  • @bto6721
    @bto6721 6 ปีที่แล้ว +6

    Greatly explained, keep up the great job [=

  • @MistaLuai
    @MistaLuai 4 ปีที่แล้ว +1

    I thought it was hard but u made it easy!

  • @niketuck9687
    @niketuck9687 5 ปีที่แล้ว +1

    What were to happen if you generated minecraft maps based on ping

  • @michaelsantamaria8306
    @michaelsantamaria8306 4 ปีที่แล้ว +1

    Thanks man

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

    Is it possible to randomly place the spawn points as well? So that the world will be truly random and without any "template"?

  • @JudahMantell
    @JudahMantell 6 ปีที่แล้ว +2

    Is there a way to make it so you can have only one of an object in a scene? Like, I want a bunch of random stuff to be spawned, like you taught, but I want one object to appear once in my world, but dont care where.
    Thanks!

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

      Hey :) ! There's definitely a way to do so ! You'll have to use lists which are basically like arrays EXCEPT you can add elements and remove elements to a list WHILE the game is running. So for example if you have a list with 1 tree, 1 ogre and 1 house, you can spawn the ogre from that list and then REMOVE the ogre from it, this way he won't spawn again :) ! Just type unity lists on Yt and you'll find some great tutorials on the topic :) !

  • @BeerfootBandit
    @BeerfootBandit 6 ปีที่แล้ว +1

    I thought it would take long to do this. Thanks

  • @isaac-jamesnel7852
    @isaac-jamesnel7852 3 ปีที่แล้ว

    I am aware this is a old video, but is this the same concept used to generate random planets in his 2nd commercial game ‘Dashing Fire’?

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

    Could this work with a tilemap set, but specifically of one with mainly walls and floors

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

    This is great, thank you for the tip.

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว

      I'm really glad you liked the video :) !! Cheers !

  • @beautifulmoon6891
    @beautifulmoon6891 6 ปีที่แล้ว +1

    noah, i like your titorial, its clearly and very easy to understand. actualy how you ca learn it any way?

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

    Fantastic! Thank you dude :)

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

    How do i make max 3 objects spawning in many spawn points?

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

    Do you happen to know how to do that with map tiles? And how to make grass tiles not mix with sand tiles, and place water tiles around everything?

  • @tiui2371
    @tiui2371 6 ปีที่แล้ว +7

    I think you could do something WAY more sophisticated with a perlin noise function (the different objects would be spawned by requiring the position of the curent object and getting the value in the perlin map. NOTE: I HAVE NEVER TRIED THIS. y? cuz im lazy).
    Aside from that great tutorial. Keep the great vids up. Also spotted a bug on the fire of belief check it out. Its on the discord page.

    • @raghavnautiyal4175
      @raghavnautiyal4175 6 ปีที่แล้ว

      +tiui50 perlin noise maps only work in 3d as far as i know but i might be wrong!

    • @giantsmoy
      @giantsmoy 6 ปีที่แล้ว

      A Perlin noise map is just a double entry array full of floats, it can be used for anything as long as you extract pieces of information from it.

  • @chinyonglim7624
    @chinyonglim7624 6 ปีที่แล้ว +2

    Blackthornprod, can you create a tutorial for joystick which can move and rotate 2d and 3d object?

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +1

      Hey :) ! I'll definitely consider making a video on the joystick topic ! Stay tuned :) !

  • @edajb
    @edajb 4 ปีที่แล้ว +2

    Hi Noah, i'm doing this in 3D (I've done everything you have in this amazing tutorial) but when i press play the objects that are meant to spawn at the spawn points do not appear. Still in the game, in the inspector the box to the left of the objects name as unchecked, even though it was checked before i pressed play.
    Please can anyone help!.......

    • @conanspit
      @conanspit 4 ปีที่แล้ว +1

      if the box is unchecked, that means that the object is not active, meaning it also won't show up. it might be that somewhere in your code the object is being set inactive.
      a quick fix for this could be to add this to the spawn code:
      GameObject obj = instantiate(...);
      obj.SetActive(true);
      this ensures that the obj is active after spawning it. if they are still not active even with this code. something else is setting them inactive after they are spawned.

    • @edajb
      @edajb 4 ปีที่แล้ว +1

      @@conanspit Thank you for the reply, i hope it will help anyone with the same problem. I ended up deleting the game object and adding the script again.

  • @possiblyjames9082
    @possiblyjames9082 5 ปีที่แล้ว +1

    Is there a way to make this for a group of 3D objects?

  • @Noyader
    @Noyader 6 ปีที่แล้ว +2

    Thanks my friend this helped

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

    Awesome video, once again!

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

    is there anyway i can also make the rotation random? *i dont know much about Quaternion*

  • @Andrelas11
    @Andrelas11 4 ปีที่แล้ว +1

    Could you further randomize this by:
    1) Creating an array of spawn points in your Level Template with a random array length (or you could specify a range).
    2) Instantiate your Spawn Points in the array in random locations.
    This would randomize the Spawn Point locations and the number that appear. I believe you could further control this by defining parameters such as the distance between each spawn point.
    Example: Only instantiate a spawn point in a location IF there is no other spawn point within 5 units.
    OR further get creative by random spawning certain things (like trees) at a higher concentration than things like gold nodes while still keeping all spawn points random. This would be helpful for random world generation in an RTS for example.

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

    I've followed your brilliant instructions to a T but I'm stupid and keep getting this error and can't make sense of it "IndexOutOfRangeException: Array index is out of range.
    LevelGeneration.Start () (at Assets/Script/LevelGeneration.cs:16)"
    if you can give me any help ill be eternally grateful :D

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +5

      Hey :) ! This error pops up because you did something wrong with the arrays, usually it comes down to having forgot to drag and drop objects in your arrays or because you removed one by mistake :). If you've writte exactly the same code as me then your script isn't the problem, just have a good look at your spawn points and their arrays and make sure all is good there ! Hope this helps and best of luck !

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

    objects.Length - 1 to avoid out of bounds errors

  • @TheGamingWiccan
    @TheGamingWiccan 4 ปีที่แล้ว

    but how would i create the ground itself using this method? let alone texture it? also how would i make the map infinitely generate in all directions?

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

    You The saviour

  • @zed8970
    @zed8970 4 ปีที่แล้ว

    thanks bro. it helped me a lot

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

    would this be considered procedural generation or random generation

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

    Good video, but Perlin Noise works much better.

  • @Jlewismedia
    @Jlewismedia 5 ปีที่แล้ว +2

    Anyone have any idea how to implement seeds into this, I want to generate the world randomly but then allow the world to save the seed and reload it then just check updated objects so the player returns to the same world. Cant seem to find much about it.

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

    thank you man! :)

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

    Wow that was really cool!

  • @philliptemidayo
    @philliptemidayo 6 ปีที่แล้ว +1

    how do you draw those kind of sprite that easily on photoshop?, my sprites are really bad:(

  • @harisspahija4885
    @harisspahija4885 6 ปีที่แล้ว +1

    Hi, thanks for the tutorial. It was very helpful, also what theme are you using in VS?

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว

      Hey and thanks Haris :) ! I'm using the default Unity theme (don't have pro yet :) ) !

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

    i used this in my project, and it works quite well, especially when you chain the spawn points together. but i need the spawned object to inherit the rotation of the spawn point. ( i cant figure out how to read the spawn point's rotation)

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

      I'm pretty sure you could just put transform.rotation instead of Quaternion.identity when you Instatiate it if you haven't already figured it out which you probably have it's been a week since you posted this comment

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

      @@choppedcheese5936 oh thx

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

    Hello, thanks for the great tutorial. Just one question: how to make this only once on the first game launch but then it stays like it? So the player has a "unique" from other players, but he keeps his same map along several game sessions

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

      save and load system
      here is brackey's tutorial for it: th-cam.com/video/dQw4w9WgXcQ/w-d-xo.html

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

      @@NoTime4Adventure bruh

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

      @@illuminoeye_gaming e

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

      @@NoTime4Adventure a

  • @arsenbabaev1022
    @arsenbabaev1022 4 ปีที่แล้ว +1

    Thats how i did it.(my templates are 5/5 units so i use +=5 in loops)
    void FillShips()
    {
    for (int x = 0; x < mapWidth x+=5)
    {
    for (int y = 0; y < mapHeight; y+=5)
    { number = Random.Range(0, List.Length);
    GameObject Shipd = Instantiate(List[number]);
    Shipd.transform.position = new Vector3(x, y_y, 0f);
    }
    }
    }

  • @terriblis-dev8549
    @terriblis-dev8549 6 ปีที่แล้ว +1

    I am working on an intro cutscene similar to "Be Yourself" or "Super Meat Boy" but don't really know how to go about doing this in Unity and there are surprisingly no tutorials on it that I can find...if anyone has any ideas I would love to hear them (also great work on the video it really helped alot)

    • @doublesystem9790
      @doublesystem9790 6 ปีที่แล้ว +1

      Terriblis-Dev I think you can just make each image and make they have a "fading in" animation. Then instantiate them and put a simple script in each so when they're instantiated they do the animation.
      There's probably better ways but i hope this was useful.

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว +1

      Hey :) ! Yep that is definitely a way you can go about making an intro scene, you can of course also use Unity's timeline and animation tools ! Or enable images whenever the player hits space... Loads of cool ways to go about doing, and come to think of it it could be an interesting tutorial topic :) !

  • @ivicaskrobo1896
    @ivicaskrobo1896 6 ปีที่แล้ว

    How would you object pool here, instead of instantiating each object on spawn points?

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

    what if I wanted to generate a random maze every game?

  • @callumchamberlain183
    @callumchamberlain183 4 ปีที่แล้ว

    @blackthornprod is there something like this for pygame??

  • @あれくす
    @あれくす 5 ปีที่แล้ว

    Hello Noah, is there any chance you could explain or make a tutorial on how FORAGER THE GAME generates its random level and creates the interface to unlock new random generated blocks? I'm trying to make a copycat game for my own learning and I can't figure out how that is done. I've failed to find any explanation online. I also have failed to find how to create a 'shimmer and shine' effect similar to that of games like bejeweled which make sprites shine to indicate they can be collected/picked up. This is also found in forager game. Please and thank you!

  • @alexts1299
    @alexts1299 6 ปีที่แล้ว +2

    Great Tip!

    • @Blackthornprod
      @Blackthornprod  6 ปีที่แล้ว

      I'm delighted to hear you found the video helpful :) ! Cheers !

  • @ir3dy976
    @ir3dy976 6 ปีที่แล้ว

    Thank you for this video and your reply in the other video... but what im wondering is, how would i have this update to a nav mesh? Ive watch Sebs videos on how to make a game with the whole level gen and random enemy spawn but im havig trouble figuring out had to add the update nav mesh to my game and scripts or should i make a seperate script the holds the nav mesh and call on the random generation script u made? So the nav will update that way? Im so lost my knowledge of scripting is very small and C# i like though its very clean.

    • @dumonyu5027
      @dumonyu5027 6 ปีที่แล้ว

      Brackeys has a video on updating nav mesh after run time. May help :)

  • @carcrashfun1550
    @carcrashfun1550 4 ปีที่แล้ว

    Question, if i have 2 sprites overlapping each other how do i make sure the one furthes away will render behind the one closer to me(more to the bottom)

  • @stephen9849
    @stephen9849 4 ปีที่แล้ว +1

    If I want to spawn enemies, instead of trees, why they can't move? (I have attached the move script)

    • @paramsachdeva114
      @paramsachdeva114 4 ปีที่แล้ว

      I am no expert, but try and remove quaternion.indentity from the spawning script. IDK if it will work

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

      You should attach the move script to the prefab of enemy itself. Then the enemy will move.

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

    can i use it for 2d mobile game ? I am using Unity.

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

    Someone please help me! For some reason, in the game tab, I can't see the prefab, but in the scene tab, I can see it. Help!

  • @adamknight4563
    @adamknight4563 5 ปีที่แล้ว

    Hi, I've used this tutorial in my space game and I have an InvokeRepeating for multiple spawn points as a child of my camera to spawn objects, but once the objects spawn-the spawn points stay and respawn objects in the same location, even after I move the camera and change the spawn locations. Is there a way to destroy the spawn points after they spawn objects? Ive used Destroy(gameObject) to destroy my spawn points, but then my InvokeRepeating wont call the method again to respawn new objects.

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

    Somebody know a way to save and load the data of the instantiate object? Like the position, or the others variables...

    •  3 ปีที่แล้ว

      Did u find an answer?

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

    can I implement this into the dongion tutorials u made?

  • @BlackKillGamer
    @BlackKillGamer 4 ปีที่แล้ว

    as soon as i create the script my inspector gets fucked up and i cant use most functions anymore wtf

  • @deepeiton6112
    @deepeiton6112 4 ปีที่แล้ว

    I Love you Man!!!

  • @kaano3770
    @kaano3770 5 ปีที่แล้ว +1

    ty, i can apply this to my 3d game too

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

      sorry i am late...you can do that

  • @frostbite6644
    @frostbite6644 4 ปีที่แล้ว +1

    Noa pls help me i followed all the steps and when i tried to drag the script into the inspector it showed a compiler error
    'Quaternion' does not contain a definition for 'identify'

    • @frostbite6644
      @frostbite6644 4 ปีที่แล้ว

      Please some one help mee

    • @frostbite6644
      @frostbite6644 4 ปีที่แล้ว

      Noa

    • @samrose9675
      @samrose9675 4 ปีที่แล้ว

      It should be “Quaternion.identity” rather than “Quaternion.identify”

    • @frostbite6644
      @frostbite6644 4 ปีที่แล้ว

      @@samrose9675 hi thanks. I fixed it.😊

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

    Code:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class LevelGenaration : MonoBehaviour
    {
    public GameObject[] objects;
    void Start()
    {
    int random = Random.Range(0, objects.Length);
    Instantiate(objects[random], transform.position, Quaternion.identity);
    }
    }

  • @qbistudio1323
    @qbistudio1323 4 ปีที่แล้ว

    help IndexOutOfRangeException: Index was outside the bounds of the array.

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

    thank you yay

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

    will this work with tile maps?

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

    Is anybody else having a problem where the objects are invisible during Game mode?