Unreal Engine Simple NPC Tutorial

Поділитися
Вставка
  • Опубліковано 9 чер 2024
  • Hello everyone. This is a quick Tutorial, how to create a simple NPC System.
    I used the Version 4.27.2 of the Unreal Engine for this one.
    Discord: / discord
    Level: www.unrealengine.com/marketpl...
    State Machine: • Unreal Engine State Ma...
    Animations: www.mixamo.com/#/?page=1&type...
    Timestamps:
    0:00 - Intro
    0:19 - Import Characters
    0:37 - Create the NPC
    2:03 - Create the State Machine
    3:40 - Create NPC Animations
    7:24 - Event Graph
    10:00 - Setup the Target Points
    13:42 - Outro
  • Навчання та стиль

КОМЕНТАРІ • 126

  • @mjesensky2760
    @mjesensky2760 Рік тому +13

    Very clear, easy to understand tutorial. Thank you so much for this excellent video!

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

    Thank you so much, man! Your tutorial really helped me!

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

    Cheers, this is helping me figure out my work flow.

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

    Very cool looking tutorial!

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

    great tutorial going to try this in UE5

  • @maestrobondz7696
    @maestrobondz7696 7 місяців тому

    You helped me a lot! :)

  • @unknow4399
    @unknow4399 2 роки тому

    Thank you man 🙏💙

  • @nand-studios
    @nand-studios Рік тому

    Bestes Tutorial für NPCs! ❤

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

      I am a beginner in this domain, can someone pls clarify what NPC stands for? Non Playable character or Non Programmable character? or something else?

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

      @@navneet2649 Non player/ playable character

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

      @@RSProduxx thanks a lot 🙏🏻❤️

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

    Love the tutorial. Really nice work.
    I used UE5 to test this. It works perfectly except the character runs constantly for some reason. It has a different Walk/Run state and a groundspeed variable.
    Goes beyond my ability to understand what determines the speed actually in this case.

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

      To adjust the Walking Speed of the NPC go the Character Movement -> Details. Search for "Max Walk Speed". This is the same as in UE4.

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

    thank you so much!

  • @moaedgaming861
    @moaedgaming861 2 роки тому

    always the best

  • @Furiac.
    @Furiac. Рік тому

    helpful, thanks

  • @BlackPara11
    @BlackPara11 5 місяців тому +1

    love!!! ❤❤

  • @laurentiupolesciuc2817
    @laurentiupolesciuc2817 2 роки тому +5

    you can make a video about pedestrians, that if the car rides on them so that they dodge, as is done in Driver San Francisco

    • @Seredias.
      @Seredias.  2 роки тому +5

      That's actually pretty easy, so you put a collision box around the AI, than cast to the Car. On begin overlap set the State to the "Dodge" State. I would combine it with a Boolean to check if the Car is Driving.

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

    Very informative, thank you!
    How would you set up a path for the characters to follow to reach a destination?

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

      With Target Points. And I think this could help as well to understand the System: ua-cam.com/video/fYSEshgc8WU/v-deo.html

  • @Mr.President107
    @Mr.President107 Рік тому

    0:02 npc just taking a casual stroll in the background

  • @AverageDev
    @AverageDev 2 роки тому

    Man..you are just freaking awesome

  • @Leon-zc4ft
    @Leon-zc4ft 2 роки тому

    Helpful!!!!!!!!!
    Thanks!

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

    Thanks! This worked for me. However, for me the actor isn't facing the direction they are walking in, is there way to fix this?

    • @Seredias.
      @Seredias.  2 місяці тому

      Sounds like the Animation is wrong or the NPC has the wrong direction in generell. Compare it with the Third Person Character Template.

  • @godofvideoss
    @godofvideoss 3 місяці тому

    I followed the tutorial identically. Very nice
    How do I adjust the distance time to the target?

    • @Seredias.
      @Seredias.  3 місяці тому

      With the Max Walk Speed inside the Character Movement of the NPC

  • @Starlit43
    @Starlit43 2 роки тому

    How do you make a character move it’s month for talking

  • @langsungintinya6191
    @langsungintinya6191 2 роки тому

    I love your lighting set, can you make tutorial please

    • @Seredias.
      @Seredias.  2 роки тому +1

      Since I am not the Creator of the Map, it wouldn't be fair. But you can get this Map from the Marketplace:
      www.unrealengine.com/marketplace/en-US/product/modular-houses

    • @langsungintinya6191
      @langsungintinya6191 2 роки тому

      @@Seredias. thank you very much man

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

    Hi Thanks for this tutorial! I have a question. When following your tutorial, from target you say to add in Int + int but the option is not there? Every other option you have displayed is fine except the int section. Have you any ideas?

    • @Seredias.
      @Seredias.  Рік тому

      I guess you're using UE5? In this Case you just search for + and connect it. Unreal changed the Math Functions in UE5.

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

      This is at 8:31 and I don't get the same options as under the subheading increment as you do, any thoughts? :)

    • @Seredias.
      @Seredias.  Рік тому

      @@reaalex I know which one you mean. If you go from the Target and search for + you will find the function "add". Do you use UE5?

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

      Thanks for your help that worked! I have actually went through the tutorial and when I click play as the AI moves to the desination points the client just freezes. I suspect it has to do with the The event graph in UE5.1 is different to the version you are using at 4:46. I tried to stitch things together what looked right but I think it's come back to haunt me :)

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

      It may be because the mannequins have updated

  • @yukisohma19
    @yukisohma19 10 місяців тому +1

    would be nice if this included the details from the other video, or if this video made it more clear there is a prerequisite video. I'm totally stopped at 5:46 because I have no idea how to make this graph and no idea which video of yours it's in.

    • @Seredias.
      @Seredias.  10 місяців тому

      Well there is no prerequisite video. I explain everything necessary inside this Tutorial. At 5:46 the State is just the condition for the matching Animation State, which was created at 2:05. The Graph itself is the default Animation Graph from the Third Person Template.

  • @CaptainWeirdBeard1
    @CaptainWeirdBeard1 6 місяців тому

    Hi, Thanks for yout great tutorials! In this one I have gone over everything and cant figure out why my character wont move to the point. The character will face and look at where it needs to go but wont move. The nav mesh is fine but I can see it wont get past 'AI move to node' in the logic. Using 5.3. Any help would be greatly appreciated.

    • @Seredias.
      @Seredias.  6 місяців тому +1

      Usually the Nav Mesh Bounds Volume is the Problem. So if you press "P", the Character and the Target should be in the Green Area. As well there needs to be a possible way (Green) between the Character and the Target. Did you use a Custom Character? If you yes, try to copy the default Third Person Character and try it with that.

    • @CaptainWeirdBeard1
      @CaptainWeirdBeard1 6 місяців тому

      @Seredias. thanks so much for your quick reply! Yeah everything is good and in the green. It turned out to be a hidden mesh under the floor that was messing with it. ugh.

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

    HELLO, I wonder to know how we can set our target points random, thus the pedestrian moves randomly, Thanks in advance

    • @Seredias.
      @Seredias.  Рік тому

      Yes, that's possible. Between the "AI Move to" and the Target Point, you can place a "Get Random Reachable Point In Radius".

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

    how we can get character animation blueprints the mixamo gives us only the animation sequence which is not available as a anim class

    • @Seredias.
      @Seredias.  Рік тому

      There is a link in the Description, how to convert the Mixamo Animations to Unreal Engine

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

    Hello. pls help me. When i want to start playing my game i cant because i have an error like this : Infinite loop detedcted. Pls help me it is very important for me

    • @Seredias.
      @Seredias.  Рік тому

      In which function was the infinity loop detected?

  • @fxy201
    @fxy201 6 місяців тому

    Please tell me, can I use this system with characters with Meta Humans?

    • @Seredias.
      @Seredias.  6 місяців тому

      Yes, you can. As long as you import them right: ua-cam.com/video/IJVxpsS1nVo/v-deo.html

  • @DanielsWacher
    @DanielsWacher 10 місяців тому

    It's me again, now that I have the target points all set up and looking nicely/working as intended, I want to mix things up and give the character more actions. For example, walk to target point 1-2-3 and at target point 5 idle for a period of time, target point 6 walk, target point 7 get on the phone, etc. Is there a way to change the state on a set target point? I hope I'm explaining it right...

    • @Seredias.
      @Seredias.  10 місяців тому

      Sure, you just need to change the State Machine. In your Case: "Walk" State to 1-2-3, than "Normal" State on Success, delay (period of time), than "Walk" State to 6-7, than "Phone" State.

    • @DanielsWacher
      @DanielsWacher 10 місяців тому

      @@Seredias. I'll do my best to figure out how to do that. Don't suppose there's a tutorial on it on your channel, is there? I've only been tinkering for about 1 week with unreal, still have a lot to figure out.

    • @Seredias.
      @Seredias.  10 місяців тому +1

      @@DanielsWacher Well the tutorial you are currently commenting under shows all the steps you requested. And what I wrote was a step-by-step description. But I can also understand that it's not easy for a beginner since my tutorials are advanced. If you want you can join the Discord Server, so the community can help.

  • @Shnuvi1793
    @Shnuvi1793 2 роки тому

    What is the use of nav mesh bounds volume?

    • @Seredias.
      @Seredias.  2 роки тому +1

      It is the Space where the AI is able to move. The Green is the possible Area.

  • @Lora-Line
    @Lora-Line Рік тому

    hello, thanks for the tuto ! but I have a problem. My character doesn't go to my target point, the AI Move To always fail. I have checked the nav mesh, it's good, and i don't know why it can't move

    • @Seredias.
      @Seredias.  Рік тому

      Okay so I guess your Character is a copy of the Third Person Character. And the "Nav Mesh Bounds Volume" include the Character and the Target Point, right?

    • @Lora-Line
      @Lora-Line Рік тому

      @@Seredias. yes

    • @Lora-Line
      @Lora-Line Рік тому

      I solved my problem ! I had a recast nav mesh or something in the sky and i deleted it. Thanks anyway for answering

  • @DanielsWacher
    @DanielsWacher 10 місяців тому +1

    For some reason my NPC just stops after reaching the first point... There are 3 of them added. Any clues?

    • @DanielsWacher
      @DanielsWacher 10 місяців тому

      Using unreal 5.2

    • @Seredias.
      @Seredias.  10 місяців тому

      So the loop at 9:40 needs to be correctly and the Target Points need to be set 11:10

    • @DanielsWacher
      @DanielsWacher 10 місяців тому

      @@Seredias. Everything in the BP is exactly like in the video and Target points are set. For some reason it can only go to 1 point without continuing to the others, regardless of order or distance, let alone loop or anything like that. So I can set in index 0 point 1 or 2 or 4 and it will go to them, but it will not move past index 0, it will not follow the other target points.

    • @DanielsWacher
      @DanielsWacher 10 місяців тому +1

      @@Seredias. Never mind , found the issue. The target points were above ground, just had to use "end" key to drop them to the ground and now it works like a charm. Thanks for the awesome tutorial!

    • @tiandao93
      @tiandao93 3 місяці тому

      Thank you Dude! I wouldn't have figured it out myself@@DanielsWacher

  • @T-UserGames
    @T-UserGames 11 місяців тому

    Which Animation asset do you use?

    • @Seredias.
      @Seredias.  11 місяців тому

      I imported all of them from Mixamo (link in the Description).

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

    I am a beginner in this domain, can someone pls clarify what NPC stands for? Non Playable character or Non Programmable character? or something else?

    • @Seredias.
      @Seredias.  Рік тому

      Non-Player-Character

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

      @@Seredias. Ohh so "P" stands for "Player"😯 Thnaks😇

  • @rohanphadnis6812
    @rohanphadnis6812 10 місяців тому

    good tutorial, but in UE5 the animations don't seem to work. that npc moves without playing its animation. and I have followed your every step.

    • @Seredias.
      @Seredias.  10 місяців тому

      Did you use the Original UE5 Third Person Character or a custom one?

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

    is there a way or do you have a video that i can be the npc, like changing into it and then playing with the so called npc?

    • @Seredias.
      @Seredias.  Рік тому

      What do you mean by that. You know that NPC means Non-Player Character. So a Character that is not a Player, to make the World more realistic.

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

      @@Seredias. Yeah i mean like followers or the onea that are mostly in your tribe or clan or whatever. The ones you can recruit to fight by you side in some games and use them as guards, followers etc.

    • @Seredias.
      @Seredias.  Рік тому

      @@diogonz7777 Ah now I know what you mean. Yes, that make sense. Good Idea, I will make a Tutorial about it.

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

      @@Seredias. Thank you very much. i will subscribe and hope i will see it soon.

  • @lordfishgaming
    @lordfishgaming 10 місяців тому +1

    hello friend do you have a video on ai crowd avoidance?

    • @Seredias.
      @Seredias.  9 місяців тому +1

      Not yet, but since I currently work with MetaHumans, I will try to integrate this.

    • @lordfishgaming
      @lordfishgaming 9 місяців тому +1

      your amassing sounds great@@Seredias.

  • @madclowninc.4233
    @madclowninc.4233 2 роки тому

    hi the walking is working but the phone is not for some reason

    • @Seredias.
      @Seredias.  2 роки тому

      Did you setup everything inside the Animation Blueprint 5:30?

  • @Lingosaft
    @Lingosaft 2 роки тому

    Hey, Great video! I'm new to UE4. I have an issue when the loop of the animation is done, then the AI goes back to the position when i started playing. This results in the AI talking a few steps then it repeats so he doesn't continue to the target point. Do you know what might cause this?

    • @Seredias.
      @Seredias.  2 роки тому +1

      Did you use the Standard Animation or a custom one?

    • @Lingosaft
      @Lingosaft 2 роки тому

      @@Seredias. I used the animation pack that you linked in the description, but I used the standard skeletal mesh. I used the MOB1_Walk_F. I did create the animationBP from scratch since I couldn't figure out how to change the skeletal mesh, maybe the problem could be there?

    • @Seredias.
      @Seredias.  2 роки тому +1

      @@Lingosaft Yes, definitely the Problem came from there. Please try out the Standard Animation, to see if that works.

  • @fxy201
    @fxy201 6 місяців тому

    Where should I get Blueprint?

    • @Seredias.
      @Seredias.  6 місяців тому

      Which Blueprint?

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

    But how to connect to animations transition?

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

      You can just use the State Machine for this. Just set the State in different Situations to switch the Animation.

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

      @@Seredias. thanks man ill try

  • @mysticx6226
    @mysticx6226 2 роки тому

    the character goes to the first point and then stays there, any help?

    • @Seredias.
      @Seredias.  2 роки тому

      Please debug this function 9:50 to see if its continue after the first Point.

    • @mysticx6226
      @mysticx6226 2 роки тому +1

      nevermind, my code was worng

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

      @@Seredias. Excellent and totally clear tutorial, thanks so much!!
      *EDIT* I had the same problem, In my case it happened because I put the targetpoints a little bit above the ground and they must be stick for some reason. Now everything works perfect. I love it :)

  • @peter486
    @peter486 2 роки тому

    yes your caracters are sliding .)

  • @MagicxReal-Studio
    @MagicxReal-Studio 14 годин тому

    i did this works perfect except walking state he just plays animation on the spot but is not moving

    • @Seredias.
      @Seredias.  14 годин тому

      Did you placed the Nav Mesh Bounds Volume, corretly? So that the Start and Target is inside the Green Area?

    • @MagicxReal-Studio
      @MagicxReal-Studio 12 годин тому

      Yea, i have one for the whole map, i have other npcs that walk randomly around as well as ai enemies that also chase and attack me , is just this one that doesnt move, i will try tomorrow after work to move him somewhere else on the map and see how it performs else i will wait for my freelancer to debug and fix it for me 🙏 ill get back with feedback after i move him somewhere else on the map😊

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

    this did not work, instead of walking straight forward, my npc goes to the right, and won t go to the next target point.

    • @Seredias.
      @Seredias.  Рік тому

      I would recommand to check the Event Graph again 7:30
      Does you NavMeshBoundsVolume include all Target Points?

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

    My character likes to hover across the map add top speed in idle animation😂
    Ive watched the vid 10 time finding the problem but i cant figure it out

    • @Seredias.
      @Seredias.  Рік тому

      Did you use the Unreal Mannequin or a custom Character?

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

      @@Seredias. i duplicated the third person character and replaced the mesh

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

      @@mikedegraaff44 that never seems to work for me either.

  • @freedomhindi4949
    @freedomhindi4949 8 місяців тому

    player not move please tell me what i do

    • @Seredias.
      @Seredias.  8 місяців тому

      Did you placed the Nav Mesh Bounds Volume 11:30 and is the Target Point in the Range of the this Volume?

    • @freedomhindi4949
      @freedomhindi4949 8 місяців тому

      Nav mesh bounds I try apply but not working,😭😭😭

    • @Seredias.
      @Seredias.  8 місяців тому

      @@freedomhindi4949 With "P" you can see the range of the Volume. The Target Points have to be in the green range.

    • @freedomhindi4949
      @freedomhindi4949 8 місяців тому

      I do

    • @Seredias.
      @Seredias.  8 місяців тому

      @@freedomhindi4949 And did you set the Variables of the NPC 11:00?

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

    Hi Seredias, cool video. Thanks for sharing that. I am
    working on an Al engine that describes
    human behavior. I
    believe it can also be used for games. I seek an expert opinion on that. Would
    you be open for exchange?

    • @Seredias.
      @Seredias.  Рік тому

      I am glad that my Tutorial helps and by the way I plan to make a hole Tutorial-Series about it.

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

    there is no state option

    • @Seredias.
      @Seredias.  Рік тому

      Did you create the Enumeration? 2:02

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

      @@Seredias. yeah

    • @Seredias.
      @Seredias.  Рік тому

      @@ugly3498 Okay where do you need the State Option?

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

      @@Seredias. i forgot its somewhere in ur tutorial

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

      @@Seredias. wait is this tutorial for attacking npcs?

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

    Npc move there arms while breathing🤣

  • @nand-studios
    @nand-studios Рік тому

    Man hört so das deutsch raus haha