How to BUILD and LAUNCH an RTS Game in UNITY - ep3. Moving RTS Units ft NavMeshAgent

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

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

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

    Legend! Best RTS videos on the tube

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

      Thanks a ton! I'm really glad you think so!

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

    I am just learning Unity and found your videos and i have to say: they are great. Perfect depth of explaining whats happening while not getting lost in details. Why dont you have more viewers?
    I will definetely watch the rest of the series and of course reproduce it :) Thank you

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

      Thank you so much! I'm really glad you are enjoying the videos! Hopefully our community will grow over time :)

  • @Mport-UK
    @Mport-UK 3 года назад +1

    This is cool mate thanks. I can clearly understand and follow what you are saying!

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

      Thanks man! I'm glad you are enjoying the videos!

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

    How to make your own agents keep distance to each other and also walk around the enemies while pathfinding in realtime?

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

      This would take some work to the AI but its a great idea to add this in the future!

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

    When you have quite a few units and tell them to move to a location because there are so many they block each other from reaching the point and just keep rotating around it as they push each other to reach it. How would we make them stop nearby the point if we have quite a few selected so that they don't keep push each other to reach it

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

      This is a great find. I have not encountered this bug yet as I have not tested with a large number of units. I will look in to adding a bit of checks to stop the calls to make a "formation" of sorts when they reach a point that another unit has already taken!

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

      Maybe in that case you could offset the destination position of ever unit in a grid. That way they all have their own space to sit after they reach the destination

  • @참새-p7b
    @참새-p7b Год назад

    When I just click, the selection is not possible, but when I drag, the enemy is selected. How do I write a script?

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

    I know that I am 3 years late, and I am relatively new to unity, but I am following along with you and am currently doing it from a first person point of view where you are controlling little mini people, and there seems to be some inconsistency with selecting my soldiers.... some times it selects them, sometimes it doesn't. I have tried calling the HandleUnitMovement in update and fixed update and other things, and nothing seems to be working. If you still reply to comments... help?

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

      Hey man sorry to hear that. It could be a Unity version thing, but it’s hard to tell on so many factors. If it’s in first person mode, it could be a distance thing etc. I would join our discord so you can share some code there to see if that helps!

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

    Great tutorial, though how would you go about setting a "patrol", ie. when you're holding a certain key you can then tell place a series of "markers" and the units will move from one point to the next in order of placement?
    Also, the movement seems inconsistent, sometimes after box-selecting units they will never be able to be unselected and sometimes units will no-longer be commandable (ie. i tell them to move but they just wont) any ideas for fixing this?

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

      Interesting, I'm not sure where your bug is coming from. Prob an issue with removing them from your selected units list?

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

    I am following your tutorials with great interest. At the moment I am still in video 3. I have seen that you have posted 11 videos. How many do you think will be necessary to explain the whole process?

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

      Well creating a full game takes a long time. But to get the basic information you need to expand on to create your own game, maybe 10 more? Though there is so much to cover. Such as menus and sounds and animations. But for the most part my other tutorials will cover things like this too

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

      @@followlithex
      Okay. Thank you very much for answering. I want to develop an RTS and your videos are helping me understand many things. I have recently started studying C #, so I know I have a long way to go yet.

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

      You will get it man just keep going!

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

      @@followlithex It's hard. I have a background as an artist and 3d designer. Starting to study code from 0 is not easy. I've been looking for tutorials for a long time to learn how to create a simple RTS. The information that appears is very scattered. Your videos are one of the most concrete things I have found. Thank you very much for sharing your knowledge.

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

      It’s likely due to setting the die function before the health

  • @loganpiercey2372
    @loganpiercey2372 4 года назад +1

    Can i get some help because when i try to box select it will work but wont stop

    • @followlithex
      @followlithex  4 года назад

      I believe this was helped in the discord community yeah?

  • @loganpiercey2372
    @loganpiercey2372 4 года назад +1

    I need help because when i go into unity it comes up with error cs0136

    • @followlithex
      @followlithex  4 года назад +1

      The error is telling you that you have are trying to declare a variable with a name that has already been used within that scope. So you are likely declaring the same var twice in the same script.

    • @loganpiercey2372
      @loganpiercey2372 4 года назад

      @@followlithex cool im planing to rewrite the script but thanks ill keep thst in mind

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

    So first off great series, it does help a lot. Keep up the good work. But I would like to add a few stuff and some guidance. For the selection process if we use rigged ( for me at least) the mouse button selection will work only with a collider on, drag selection doesn't matter it will work. But I have a small problem with movement even though I followed to a T every time I press right click it kicks with a null expression, how to fix it , I tried giving the terrain a layer but it didnt work either . I must say that the terrain is imported and used a script to "convert" it to terrain metadata and works fine with grass trees placement etcetera beside themovement part.

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

      The message i'm getting:
      NullReferenceException: Object reference not set to an instance of an object
      LP..FDG.Units.Player.PlayerUnit.MoveUnit (UnityEngine.Vector3 destination) (at Assets/Scripts/PlayerUnit.cs:18)
      LP.FDG.InputManager.Input_Handler.HandleUnitMovement () (at Assets/Scripts/Input_Handler.cs:97)
      LP.FDG.Player.Player_Manager.Update () (at Assets/Scripts/Player_Manager.cs:21)

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

      Ok last spam sorry :(. Fixed it, so basically for some reason on the private NavMesh it wasn't working but when changed to public placed every unit agent in its prefab it worked fine. Hope somebody will find it usefull

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

      Yep! As I was reading this I assumed it had something to do with the NavMesh xD Glad you were able to find the solution!

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

      @@followlithex Haha thank you although I still don't get as to why NavMesh wasn't working on private

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

    Can use android platform?

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

      Yes you can but some code is a bit different for different types of touch controlls

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

    amazing!!!!!!!!!!!!!!!!!!

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

    Thank you for these tutorials, though I'm a year late in spotting them. Has anyone ever told you that you look like Sheldon Cooper (Big Bang Theory)? 😂 or maybe it's the just camera angle

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

      Haha nope! I haven't heard that one yet! lol

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

    Wow

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

    hi man i has just try to repeat all what you show on this video but when I try to move my units Unity say "Object reference not set to an instance of an object
    LP.FDG.Unit.Player.PlayerUnit.MoveUnit (UnityEngine.Vector3 _destination) (at Assets/TestElements/Scripts/PlayerUnit.cs:string 20)
    LP.FDG.InputManager.InputHandler.HandleUnitMovement () (at Assets/TestElements/Scripts/InputHandler.cs: string 94)
    LP.FDG.Player.PlayerManager.Update () (at Assets/TestElements/Scripts/PlayerManager.cs:string 23)". How can I fix all these problems?

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

      This error means that you likely don’t have something set in either your hierarchy or declared in your scrip

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

      You can double click the error for it to take you to the scrip and show you the line :)