How to Track your Path (like The Legend of Zelda: Breath of the Wild - Unity Tutorial)

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 105

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  Рік тому +7

    💬 Are you looking forward to Tears of the Kingdom? I'm hoping I can find the time to play it!
    ✅ Get the Project files and Utilities at unitycodemonkey.com/video.php?v=Foztn0kDM7I
    🎮 Wishlist my Steam game! cmonkey.co/dinkyguardians
    ❤ Watch my FREE Complete Course ua-cam.com/video/AmGSEH7QcDg/v-deo.html
    🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
    👍 Learn to make awesome games step-by-step from start to finish.
    🎮 Get my Steam Games unitycodemonkey.com/gamebundle
    POLYGON Fantasy Kingdoms Pack cmonkey.co/synty_fantasykingdom_trackpath
    🔴 RELATED VIDEOS 🔴
    Kickstart your game with First and Third Person Controllers! (FREE Unity Starter Assets) ua-cam.com/video/jXz5b_9z0Bc/v-deo.html
    Make Awesome Effects with RenderTextures! (Minimap, In-game TV, Camera to Texture) ua-cam.com/video/Ah2862Gz3_s/v-deo.html
    How to DRAW inside Unity! (Paint, Design, Strategize, Mod) ua-cam.com/video/XozHdfHrb1U/v-deo.html
    Simple Saving and Loading with JSON to a File (Unity Save System Tutorial for Beginners) ua-cam.com/video/6uMFEM-napE/v-deo.html

  • @carndacier
    @carndacier Рік тому +40

    I'm convinced CodeMonkey lives in a universe where there are 36 hours in ONE day, because of all the quality content your produce.
    Thanks for all the help, you're awesome ! :)

    • @rithikkumarc
      @rithikkumarc Рік тому +3

      so true 😂, and he makes courses and games and hits gym often

    • @alexleonardkrea
      @alexleonardkrea Рік тому +1

      His universe has to have at least 5x the amount of hours as this one haha: tutorials, courses, Livestreams where he answers questions, and two steam games at once!

    • @49wares
      @49wares Рік тому

      🤣👍True, i agree.

    • @Hazzel31337
      @Hazzel31337 Рік тому

      i agree

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +3

      Heh I wish I had 36 hours! No matter how much I work I can never do everything that I would like to do!

  • @SwapnilPatil-u9z
    @SwapnilPatil-u9z Рік тому +6

    Hey, great tutorial. One small hint, you can write "^1" instead of "pathPositionList.Count - 1" to access last element of an list.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +3

      Heh yup that's a nice recent C# addition, I still haven't gotten in the habit of using it

  • @faldruid8412
    @faldruid8412 Рік тому +6

    Both kitchen classes are amazing I'm almost done with multiplayer! I highly recommend the paid version just because it does such a good job of breaking it up in a nice way and you support a great unity teacher!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +2

      That's awesome, I hope you've learned a ton! Thanks for your support!

  • @rid6233
    @rid6233 Рік тому +4

    This is probably gonna be very helpful for my new game, thank you code money for making such high quality videos

  • @mohamedmusthafa1057
    @mohamedmusthafa1057 Рік тому +3

    With CodeMonkey Tutorials I will be Reach My Dream Job soon One of the Best tutor I Ever Seen ❤

  • @Gredran
    @Gredran Рік тому +2

    This is incredible!
    I’d love to see you stream your research also about how Nintendo made their new building system in TOTK.
    It’s so layered that the building system alone would probably be a series, its insane how it uses no grid but all the pieces fit and don’t break the physics etc.
    It’s amazing how it all works and you don’t clip through terrain or when recalling, it doesn’t make any collision or clipping issues.
    I’m sure it’d be extensive, but I think the internet is definitely stumped how they made that system and it seems to be bug free lol

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Yeah definitely a very impressive system, my first thought is some attach points kind of like my Weapon Attachment system but it seems to have fixed points combined with some freeform points unitycodemonkey.com/video.php?v=b6XYqtTYnc4
      The physics part should actually not be too difficult, it's mostly just playing with making all the objects a child of the same transform and applying physics on a certain position on the parent.
      It's definitely something I'd love to research in more detail, just need to find the time!

    • @Gredran
      @Gredran Рік тому

      @@CodeMonkeyUnity np! Just wondering if it was even on your list!
      Also sidenote, I’ve done a lot of engine hopping recently. I was learning a ton of Godot but my real life friend got really good at unity so I’m back on the Unity grind 😊
      Of course using your videos for basics and refreshers!

  • @jud.su.5developer895
    @jud.su.5developer895 Рік тому +2

    Your experience is incredible . You re amazing❤

  • @alec_almartson
    @alec_almartson Рік тому +2

    Thank You, 💥💯👍🏻this is very useful.
    I will try it out, as this is a very popular mechanic (and a cool one)

  • @ChrisBurns3D
    @ChrisBurns3D Рік тому +1

    I'll be adding that to my games. Thanks!

  • @Knuckles2761
    @Knuckles2761 Рік тому +3

    I think that if you run long enough completePathPositionList will overflow string capacity in PlayerPrefs. PlayerPrefs' string is not the same string type as just regular string, I believe it is 2048 symbols max and it is relatively small number (regular string is up to 2GB).

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +2

      Yeah I only used PlayerPrefs for this super quick demo, for save game data you would store it in a regular file like I covered in the Saving and Loading video.

  • @mostlypixels2975
    @mostlypixels2975 Рік тому +1

    You always upload the tutorials I need when I need them. So weird 😅

  • @mariokartgameplay6622
    @mariokartgameplay6622 Рік тому +1

    Nice tutorial, this is a great idea for a new feature which i can bring later into my game:)

  • @goldone01
    @goldone01 Рік тому

    Really minor suggestion, but you can now initialize fields directly, so you don't need to do it in awake anymore - which makes code a bit cleaner I find. I.e. in your case: private List positionList = new();

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      Yup I know but personally I prefer initializing objects on Awake, usually I only use the constructor initializer for ints/floats.
      But yup it's just personal preference, if you like doing it like that then yup go ahead.

  • @dbweb.creative
    @dbweb.creative Рік тому +3

    Coroutine with a delay, instead of update check? Pros / cons? I am just contemplating if I should use coroutines more... for example for periodic or delayed action ticks

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Yup that works, personally I dislike coroutines because of the pattern they force you to use, so I prefer simple float timers but coroutines work just as well.

  • @ekumisaki
    @ekumisaki Рік тому +1

    There is a much better way to render the path line. By using the renderer feature in urp or custom pass in hdrp can completely hide the path on the player's camera and render on top of everything in the map camera.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +2

      Yup that works, another simpler approach is just put the LineRenderer on a Minimap layer that only the map camera an see

  • @DrGroo
    @DrGroo Рік тому +1

    Thanks for another great tutorial.
    One thing that occurred to me while viewing was that the some interesting choices in the update guard logic maybe could have been discussed a bit more. If I was reviewing this code I'd be asking: what's the advantage of having both a min time delta (trackTimerMax) and a min distance delta (minPathDistance). What advantage does this have over just minPathDistance, apart from a removing a few vector ops per frame? E.g., with just distance delta you don't need to worry (so much) about unexpectedly high movement speed.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      Yeah that's the only advantage, it doesn't waste doing 60 distance checks per second but that's unlikely to be much of an advantage, so you could remove the timer if you wanted.
      Personally if I were building this in my own game I would keep it simply because even though a distance check isn't expensive, if there's no reason to do it then I might as well save a few nanoseconds.

  • @49wares
    @49wares Рік тому +2

    Nice, classic and always needed/at least helpfull functionality. 😀👍

  • @dbweb.creative
    @dbweb.creative Рік тому +1

    A bit different topic: how would you approach making an object in the world to be highlighted? What I mean is... for example in WoW when you mouse over a usable world object - it becomes brighter. Do I really have to swap texture/shader or is there some better way?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Depending on the Shader you can just change a property, that's what I'm doing in my game Dinky Guardians, as the player approaches an object it simply tells the shader to change the outline color

  • @ByronBennett
    @ByronBennett Рік тому +1

    Wonderful!

  • @Digildon
    @Digildon Рік тому

    Thank you

  • @DieHashtagBrudis
    @DieHashtagBrudis Рік тому +1

    Would it not be better to save the new position with the offset instead of cycling through it every time and adding it? For example, if you have a save with 1000h and you have been running all the time around, so that you saved every 0.2 seconds a new position, then you would cycle through 18 million points every time when you load the visuals.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Yeah you could definitely improve the performance there if you needed to. The big question is do you need both the regular list and the offset list or not

  • @NeilDonkin
    @NeilDonkin Рік тому

    Great tutorial, as always, thanks.
    Is there a way to prevent the player from seeing the path floating in the sky?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Yup, put the LineRenderer in its own layer and make sure the main camera doesn't see that layer but the map camera does

  • @michaelp8376
    @michaelp8376 Рік тому +1

    Neat, thank you!

  • @SimonDarksideJ
    @SimonDarksideJ Рік тому

    Nice tutorial, but a point on performance, should be using Queue and Stack instead of lists, especially since the index access is linear.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      Sure that's technically right but the difference is on the order of nanoseconds

  • @PerryLee-d3j
    @PerryLee-d3j Рік тому

    Dear CodeMonkey Teacher, hello. I am wondering how much you know about the Unreal Engine 5. I am a beginner who has only been exposed to game engines for about three months. I would like to ask for your opinion on the future prospects of Unity and Unreal Engine 5. Which one do you think will have a better development in the future? I am very confused right now and don't know which one to learn.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      I don't know anything about Unreal, never used it.
      Both engines are excellent, just pick one and start learning. Personally I love Unity but Unreal is also excellent.

  • @ha7anali313
    @ha7anali313 Рік тому +1

    Hey Brother i loved the Indepth Tutorial on this But i Once had to implement the same kind Of function in my proj so what i did that i used line renderer and Change the layer To an specific layer and i extruded the Line layer From my main camera and Set it true in my Minimap camera it worked perfectly fine but i had 1 issue that my textures were not rendering as expected so i had to change line rendere rotaion a lil bit but Yeah Thats how i did it Let me know What you think about it

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +2

      Yup that would be the right way to do it, that way it only renders on the minimap camera and not the main camera.
      For the rotation, it should work as long as you set it to "View"

    • @ha7anali313
      @ha7anali313 Рік тому +1

      @@CodeMonkeyUnity Thanks,

  • @overlord--
    @overlord-- Рік тому

    Can you make a tutorial like this but for something like a Heatmap? Useful to tell where players have and haven't been for the developer.

  • @Lanmind01
    @Lanmind01 Рік тому +1

    Video upload timed impeccably. That’ll do pig. 🎉

  • @sephypantsu
    @sephypantsu Рік тому

    Can you do a video on how to create the ultrahand feature from Tears of the kingdom where you can assemble your own machines freely?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Yeah that's definitely something I want to research, if it's easy I might do a video on it

  • @DJnoratos
    @DJnoratos Рік тому

    Except that it is visible above player and the Y offset is redundant. Rather you should had made a camera that would render only that LineRenderer and put LineRenderer on separeted layer. Then you could easily set CameraLayer so it would be always above and not visible to Player camera.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      The offset was more to make it show up on top of overhangs (like when moving under the castle entrance) rather than to just make it invisible to the player camera. For that yup you would use a layer to make sure it is only rendered on the minimap.

  • @deraminator945
    @deraminator945 Рік тому +1

    Hey CodeMonkey, this has nothing much to do with this tutorial, but I was wondering if there is a way to show particle effects within the UI with the built-in renderpipeline?
    As in for example, if you press a Button from the UI, the button disappears and triggers a particle effect in the same position :)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +3

      I know the particle system has some issues/limitations with the UI but I can't remember exactly what they are.
      I think the issue is it doesn't work on a regular canvas so I think you would need to make a second camera just for those UI particles and stack it on top of the main camera. The tricky part is doing the math converting the mouse position from Screen Space to world space and making sure the UI camera is Orthographic and is sized correctly.

    • @deraminator945
      @deraminator945 Рік тому +1

      @@CodeMonkeyUnity Thank you for the quick answer :)

  • @shooterho1525
    @shooterho1525 Рік тому

    Hi Code Monkey, I really hope you could do a course on building a simple MMO game with a database. Will that be happening anytime soon?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      I do want to do a lot more research on Multiplayer and exploring MMOs is certainly something I'd love to try out since I've never done it, but no idea when so probably not soon.
      You can look at the videos I did using Azure for persistent storage, that's basically how you do it unitycodemonkey.com/video.php?v=EEQfSmK1nXA

  • @joyoussuccess
    @joyoussuccess Рік тому

    how about, killcam / play of the game system with FishNet .. i think its you send all inputs to the server authoritative and it saves all the inputs and server is authority so it is always just taking inputs and playing the game in the server, and it saves all the inputs in a file and timestamp.. ... however which way it is best to save that info .. json or something idk .. and then it replays the game at any time cause it has the inputs at all times .. something like this

  • @marksmithcollins
    @marksmithcollins Рік тому +1

    OMG at least expected to store data in linked list...
    A great example of 'Russian Painter' for scaling like real Zelda.

  • @pyrskaa5383
    @pyrskaa5383 Рік тому

    What is your opinion on the unitys junior programmer create with code course do you think i could use it to learn unity

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      I haven't gone through it myself but I have heard great things about it, so yup I would say go through that then go through my Kitchen Chaos course

  • @Thomas-qc2dc
    @Thomas-qc2dc Рік тому +1

    Honestly, I think that was left in from some debug mode for BOTW. I’m pretty sure it was Nintendo’s first open world game so they did a lot of play testing tracking player movements.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Yeah I remember this feature wasn't visible at launch, they enabled it after some months and apparently it was tracking the whole time

  • @michaelwhaley4638
    @michaelwhaley4638 Рік тому

    do you have any discounts or specials for your online classes?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      If you follow the links from the website they should have some coupon attached

    • @michaelwhaley4638
      @michaelwhaley4638 Рік тому

      @@CodeMonkeyUnity Code Monkey Bundle $997.00 what is in this bundle?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      What bundle are you looking at? Are you talking about the JasonWeimann courses?

    • @michaelwhaley4638
      @michaelwhaley4638 Рік тому

      @@CodeMonkeyUnity yes, with your courses included.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      The Jason Weimann bundle only includes several of Jason's courses, not my own

  • @ritzenhauf
    @ritzenhauf Рік тому +2

    Why use a timer if you know you're only going to add a position after some distance anyway?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      Sure you could do that, it would waste a bit of performance doing a distance check on every single frame but sure that's a valid option.

    • @NecrotekLabs
      @NecrotekLabs Рік тому +1

      @@CodeMonkeyUnity I mean if performance is a req than using time.time instead of ticking a timer is better. Waste of an instruction by adding every frame.

    • @ritzenhauf
      @ritzenhauf Рік тому

      nice. thanks all!

  • @random_precision_software
    @random_precision_software Рік тому +1

    I wish you'd do a video on pseudo 3D road in 2D like pole position and Outrun games from the 80s. I'm can't find anyone who knows how to do it. 😢

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      The best way is to simply make it 3D and use a Orthographic camera.
      If you really want just 2D then I think you would essentially make extremely thin "slices" of the road and dynamically stack then on top of one another, then move the slices left/right to make the curves.

    • @random_precision_software
      @random_precision_software Рік тому

      @@CodeMonkeyUnity ok thanks ill try that

  • @defense_x86
    @defense_x86 Рік тому

    Why is zelda by nintendo so popular?

  • @monkeyhelp
    @monkeyhelp Рік тому

    Supurb

  • @robotizar
    @robotizar Рік тому

    Another option is use linerenderer

  • @newlinebraces2872
    @newlinebraces2872 Рік тому

    Boop

  • @utkugulcu232
    @utkugulcu232 Рік тому

    6:55

  • @AlexRak2
    @AlexRak2 Рік тому +17

    whyyyyyyyyyyyyyyyyyyy, why do you use light mode how dare you. my eyes burn xD

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +25

      Sorry but dark mode burns my eyes

    • @teroblepuns
      @teroblepuns Рік тому +3

      Light gang rise up

    • @iggyboyo
      @iggyboyo Рік тому +2

      Coding elitists are so annoying. Let him do whatever he wants lol

    • @AlexRak2
      @AlexRak2 Рік тому +2

      @@iggyboyo why you getting triggered lol it was a joke.

    • @iggyboyo
      @iggyboyo Рік тому

      @@AlexRak2 just asking you to let him be, that's all

  • @wasdolgaming6718
    @wasdolgaming6718 Рік тому +1

    Ha i'm the first :) :)))))))) (i know it is bad but i'm proud of myself)

    • @EnemyOTS
      @EnemyOTS Рік тому

      Damn! you beat me to it

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      I hope you like the video!

    • @EnemyOTS
      @EnemyOTS Рік тому

      @@CodeMonkeyUnity oh it's fantastic. I'm a big fan of your work. Learned alot from you. So thank you for all the hard work.

    • @wasdolgaming6718
      @wasdolgaming6718 Рік тому

      @@EnemyOTS :)))))

  • @johncoles2415
    @johncoles2415 Рік тому

    You realise it isn't a tutorial if you just talk at the camera while doing everything not explaining it, right?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      What part couldn't you follow? The script was literally created from scratch on screen

    • @johncoles2415
      @johncoles2415 Рік тому

      @@CodeMonkeyUnity You zip through the code without clarifying each phase. I just don't think it's all that helpful for people to simply copy ad nauseum without understanding it.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому

      If you specific exactly what you didn't understand I'm happy to provide extra clarification, but without specifics I can't do much more to help

  • @holyshiftstudio
    @holyshiftstudio Рік тому

    Neat, thanks for this