Create AI that traverses obstacles on its own using the Game Animation Sample motion matching!!

Поділитися
Вставка
  • Опубліковано 20 жов 2024
  • In this I try to approve upon the basic following I created in the first video. I will also give the AI the ability to traverse objects on their own while giving chase.
    The bulk of the code happens within the AI event graph off of the Event Tick node.
    The code added in the sandbox character (follow/not follow) is toggled by the 1 key ( I never stated that in the video )
    For the Nav Link Proxy you want to copy the Left Point Link of the Simple Link and paste it to the Link Relative Start of the Smart Link and then copy the Right Point Link location of the Simple Link and paste it to the Link Relative End location of the Smart Link.
    Everything but the AI traversing is based of off 5.3 motion matching code from jourverse at • Unreal Engine 5.3: Mot...

КОМЕНТАРІ • 43

  • @treehousebandit
    @treehousebandit  Місяць тому

    The creation of calling the FindNextPathPoint node off of the Branch was cut from this video. At the end of the code stemming from the event tick, off of the true option on the branch call the FindNextPathPoint function created around 11:10. If you pause at 13:55 you will see where that function needs to be called.

  • @Deculayn
    @Deculayn 3 місяці тому +1

    Thanks for the second AI tutorial.
    Would be great if you could show how to turn this AI to an enemy.

  • @TJ_The_Dev
    @TJ_The_Dev 2 місяці тому +1

    another great video! thanks !

    • @treehousebandit
      @treehousebandit  2 місяці тому +1

      yw and ty! can't wait to see what you cook up

    • @TJ_The_Dev
      @TJ_The_Dev 2 місяці тому

      @@treehousebandit I still need some time to preapre all material I want to show :) but I hope you will see that soon !

  • @petyx5569
    @petyx5569 3 місяці тому +1

    Well done, thank you

  • @rudeboy5000
    @rudeboy5000 2 місяці тому +1

    Thats fucking awesome! Is there anyway to make it a component? Or maybe show us how to use behavior trees? Ive followed this tutorial and im definitely adding this to my main game idea. 😅

    • @treehousebandit
      @treehousebandit  2 місяці тому +2

      @rudeboy5000 thats a great question , I can't think of a reason why it wouldn't work as a component. I definitely will get into behavior trees at some point in the next couple months. Am currently trying to make a fun combat system before moving it to the behavior tree

  • @zinxzinxsh1293
    @zinxzinxsh1293 2 місяці тому +1

    i done step by step in last video and in this BUT it seems something is missing in 10:17. something was cut ? i mean like some code magically appear

    • @treehousebandit
      @treehousebandit  2 місяці тому

      at 10:17 the creation of the arrive at location node was cut, when i'm moving the add movement input to in front of that arrive at location node make sure you have that arrive at location node in there with the next target location plugged into the location.

    • @crostianrotaru1368
      @crostianrotaru1368 2 місяці тому +1

      @@treehousebandit I'm sorry, but I don't quite understand what to do at 10:17. what and with what should be connected

    • @treehousebandit
      @treehousebandit  2 місяці тому +1

      @@crostianrotaru1368 Sorry for the confusion. Pause the video at 10:36 and recreate the code there. You will want the branch that is checking start movement value > add movement input node > arrive at location node > another branch (plug the arriveatlocation return value into the branch )

    • @crostianrotaru1368
      @crostianrotaru1368 2 місяці тому +1

      @@treehousebandit Thank you very much

    • @viraj3944
      @viraj3944 Місяць тому

      @@treehousebandit Showing a compilation warning -----
      Direction to Target was pruned because its Exec pin is not connected, the connected value is not available and will instead be read as default

  • @cobrakia9889
    @cobrakia9889 2 місяці тому +1

    I'm getting a Blueprint Runtime Blueprint Runtime Error: "Accessed None trying to read property CallFunc_FindPathToLocationSynchronously_ReturnValue". Node: Set Path Points Graph: FindPathPoints Function: Find Path Points Blueprint: NPC_StockGASP". I followed step by step but im getting this error.

    • @treehousebandit
      @treehousebandit  2 місяці тому +1

      Do you have a nav mesh bounds volume in the map? if so make sure it is as large as the area you want your NPC to travel on and that it is overlapping the ground you want them walking on. When you press P in the editor you should see the nav mesh bounds.

    • @cobrakia9889
      @cobrakia9889 2 місяці тому

      ​@@treehousebandit No i don't have any kind of nav mesh. I followed the first tutorial with success on a blank project. I rewatched this video a few times to catch any mistakes i might have missed or boxes i forgot to check and everything is the same. The only time my follower moves is if I Press the I key to activate the event, then it runs straight to the Unreal logo and just stops moving. Is there anyway to change the Return Value in the Find Path to Location Synchronously node to reference another navigation?

    • @treehousebandit
      @treehousebandit  2 місяці тому +1

      @@cobrakia9889 The find path to location synchronously node specifically uses nav mesh bounds data, I don't add it in this video but I briefly mention it before adding the nav link proxy. The npc is running to the 0,0,0 of the map because it couldn't find a path because there was no nav mesh and it stops because the (0,0,0) was added as the goal location when it couldn't find a path.

    • @cobrakia9889
      @cobrakia9889 2 місяці тому

      I added the Nav Mesh and I’m no longer getting and errors but my NPC still only runs to the 0,0,0 location. I spread it as large as the level course and it still can’t find its path. Also is it supposed to run to the player on start because the NPC only activates when I hit the keyboard key. Thanks for your help 🙏

    • @cobrakia9889
      @cobrakia9889 2 місяці тому +1

      @@treehousebandit I solved the Issue. I was missing the Find Next Path Point after the Branch in the Event Graph. It works now. Thanks again.

  • @ZeliusDev
    @ZeliusDev Місяць тому +2

    when i press 1 the AI will just turn towards my direction and not follow me

    • @ZeliusDev
      @ZeliusDev Місяць тому +1

      or the AI will take a long time and finally follow but then its like it get confused and doesnt know whats its doing

    • @treehousebandit
      @treehousebandit  Місяць тому

      @@ZeliusDev I'm sorry to hear you're having issues this was one of my first tutorials. off the top of my head I'm not sure what the issue could be. In this video I do know I only state the importance of the nav mesh bounds once and there is a bit at 10:17 where some code creation is lost. if you pause at 10:30 the code you need off of the event tick is there. if it's not either of those I could look into it a little deeper to see what's up.

    • @ZeliusDev
      @ZeliusDev Місяць тому

      @@treehousebandit i added the lost code already :(

    • @ZeliusDev
      @ZeliusDev Місяць тому

      i mean its working but its like it delays for a long time and then it movements are all jittery and random like its searching for a path to me

    • @ZeliusDev
      @ZeliusDev Місяць тому

      also when the ai moves it sometimes glides and is frozen in animation but is still moving weird