AI Sight Detection And Chase With Music - Unreal Engine 4 Tutorial

Поділитися
Вставка
  • Опубліковано 30 лип 2024
  • Hey guys, in today's video, I'm going to be showing you how to create an AI which can detect the player through sight and then start chasing the player, while playing chase music in the background. This will then fade out when the AI can no longer see the player and isn't chasing anymore.
    Chase Music: freesound.org/people/burning-...
    #Ue4 #UnrealEngine4 #Ue4Tutorial #Horror
    ___________________________________________________________________________
    00:00 - Intro
    00:15 - Overview
    00:49 - Tutorial
    10:17 - Final Overview
    10:33 - Outro
    ___________________________________________________________________________
    Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
    The Basics Of Nodes Playlist: • The Basics Of Nodes In...
    Blender Tutorials Playlist: • Blender Tutorials
    ___________________________________________________________________________
    If you enjoy make sure to subscribe: / @mattaspland
    Join My Discord Server: / discord
    Follow Me On Instagram: / matt_aspland_
    ___________________________________________________________________________
    If you want to support me, you can PayPal me at "matt.aspland.1@gmail.com". This is by no means expected or required. It is just a nice support :)
    Link to PayPal: www.paypal.com/
    You can also support me on Ko-Fi following this link: ko-fi.com/mattaspland
    Thank you :) ___________________________________________________________________________
    ♫Music By♫
    ●Kronicle - Chill Noons
    ●Soundcloud - / the-chemist-10

КОМЕНТАРІ • 244

  • @MattAspland
    @MattAspland  3 роки тому +28

    Hey guys, with the delay at 06:35, in between the two branches for "CanSeeEnemy?". If you increase the duration, the player has to be hidden from the AI for longer before the AI loses sight. So increase the duration as much as you like for different effects and difficulties. Or if you think it is losing you too quickly.

    • @lexxrelaxx2016
      @lexxrelaxx2016 3 роки тому +3

      The Ai doesnt stop chasing me. I tried to change delay but Ai keep following me :( what can i do?

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

      @@lexxrelaxx2016 same

    • @MrChick1984
      @MrChick1984 2 роки тому +4

      @@bassboot5357 I think, it is because the AIMoveTo function does not stop until it gets to your position or is not able to get there (like you are out of nav mesh). Anyway to fix it, call StopActiveMovement function on AI character, when you stop music.

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

      @@MrChick1984 Thank you so mutch! Thats just what i searched for!

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

      @@lexxrelaxx2016 i had the same problem but i fixed it

  • @giancalabrese
    @giancalabrese 3 роки тому +4

    You are a legend, thanks for these tutorials!

    • @MattAspland
      @MattAspland  3 роки тому +1

      Thank you man, no problem, happy to help! :)

  • @beamngsamurai8
    @beamngsamurai8 3 роки тому +1

    Thank you so much for this.
    Your helping me very much I did not want to make a game in UE4 but your tutorials are very good.
    Thank you again my fiend.

    • @MattAspland
      @MattAspland  3 роки тому

      No problem, I'm happy I can help you, no problem and best of luck of luck with your game :)

  • @GaryParkin
    @GaryParkin 3 роки тому +21

    I didn't know you could do all this without the behavior tree. Wow, thank you.

    • @MattAspland
      @MattAspland  3 роки тому +5

      Yep, I find it easier to understand like this. No problem :)

  • @timsonss
    @timsonss 3 роки тому +1

    Lets goooo great as always my man

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

    Thank god, I was searching this tutorial for day

  • @cinomontague
    @cinomontague 3 роки тому +24

    These are by far the best Unreal Engine tutorials I've found and I've been searching night and day

    • @MattAspland
      @MattAspland  3 роки тому +3

      Thanks so much man! Always happy to help! :)

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

      On god

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

      true

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

      Your search is now over my son. You have reached your final destination, total enlightenment and immortality...

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

    You are A Great Teacher!! thank you for your great detailed tutorial, much needed, concise and practical , appreciate all of them!!! Still, if you could please consider explain for a few sentences the objectives(as small intermediate steps to achieve the final objective) each time before you start doing something (i.e. start blueprinting) , then your tutorial will be perfect, the most helpful way for us noobs to quickly learn is to follow your thought process before implement the coding. Thankfully You did this but mostly at the end of the coding , a reverse of the teaching order can significantly reduce the learning time for idiots like me. again, thank you very much. God bless

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

    thanks i really like your videos you help me a lot

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

    Hi matt. Love the ai chase videos. Can you do a tutorial where there are 2 different modes, neutral and hunt, so when the ai sees the player then goes out of chase mode it looks around the area for a minute or 2 then go back to neutral?

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

    Amazing tutorial!! It's so creepy

  • @abdullahsohail5395
    @abdullahsohail5395 3 роки тому

    Thanks for making that video it will help me alot me in horror game liked your video

    • @MattAspland
      @MattAspland  3 роки тому +1

      No problem, happy to help :)

  • @ravenx116
    @ravenx116 3 роки тому

    literally first working tutorial on ai

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

    In case anyone else has the problem where it chases you after it shouldn’t be able to, just add a retriggerable delay after the “set” that changes “can see enemy?” to false and change it to what time you want him to give up after and then a “stop active movement” and it’ll stop chasing you

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

      ty

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

      Hey thank you that was really helpfull

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

      @@Balkor glad I could help!

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

    you are awesome, helped me so much for my class lol

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

    Thank you man

  • @deridionentertainment
    @deridionentertainment 3 роки тому

    Amazing. I love you video

  • @TheTrueAlpha-gx6iv
    @TheTrueAlpha-gx6iv Рік тому

    this is a great tutorial! This is one step for me on my backrooms game!

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

    Thank you!

  • @yucelb
    @yucelb 3 роки тому

    awesome thank you matt :)

    • @MattAspland
      @MattAspland  3 роки тому

      Thank you and no problem man :)

  • @varundoshi5136
    @varundoshi5136 3 роки тому

    Brilliant tutorial

  • @erykbugajski7747
    @erykbugajski7747 3 роки тому +3

    Hey great tutorial. Is there any way to lower the volume of the music?

  • @timsonss
    @timsonss 3 роки тому +5

    My Mr X AI is gonna be juicy with that tutorial! Can you make a tutorial on how to make enemy spawn randomly in selected area? Kinda like mr x or any game with chase enemy (phasmohpobia, hello neighbor)

    • @MattAspland
      @MattAspland  3 роки тому +2

      Hey, of course yeah, I can look into that :)

  • @babapeer1651
    @babapeer1651 3 роки тому

    Thanks it works

  • @greaver5470
    @greaver5470 2 роки тому +2

    Hi Matt, thank you VERY much for the tut. Your style is clean, but not as clean as your pronunciation! I hope you are still reading your comments... how would you deal with multiple enemy sound overlap? I have multiple enemy spawns in the level and the sound clip overlaps, creating a cacophony! I will try to solve, but would appreciate a tip. Thanks again, even if you don't reply.

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

    THANK YOU!!!!!

  • @1.1st
    @1.1st Рік тому

    Thank u so much i thoght theres problme in this way because when enemy chasing you he will leave you never in the nav volume ..Until I saw the second part

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

    Hi Matt. I've got this working, but suppose there are 2+ AIs. I want it to be the case that when both are chasing me, there aren't 2 audio tracks trying to play over one another. I was wondering if it was possible to have "World Music" playing upon being chased. When you can, let me know your thoughts on the matter and if it's way more overhead than I'm thinking

  • @MrMingles
    @MrMingles 2 роки тому +2

    Hey. Tutorial is great and the chase works perfectly fine, but I have one issue.
    When the ai is chasing me and I’m from a far away distance, the music glitches in and out, but when I’m close to the ai, the music is fine.
    Any way to fix this?

  • @Alex00m
    @Alex00m 3 роки тому +7

    Yes😁 Do more AI stuff, iam waiting for behavior tree😁😁

    • @MattAspland
      @MattAspland  3 роки тому +4

      Thank you, I'll hopefully get around to it, but I plan on doing more definitely :)

    • @Si-Toecutter
      @Si-Toecutter 3 роки тому +2

      Behaviour trees confuse the hell out of me, I don't know if to keep building on a basic A.I in BP or you mix the two ?

    • @Gaelrenaultdu06
      @Gaelrenaultdu06 3 роки тому

      @@Si-Toecutter The way Matt showed how to set up the AI in this video is decent, but when you begin to place hundreds of characters on your level/map, with an AI logic for each of them, that can start getting quite heavy.
      What you should do is create and attach an AI component to the ennemy blueprint, create a behavior tree, and run the behavior tree on the begin play event in the AI component.
      Try avoid building the logic inside each AI character, build it in the behavior tree.

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

    Nice tutorial bruh, I like the Metal Gear Solid wannabe chase music lmaoooo

  • @UnsealedWings
    @UnsealedWings 3 роки тому +2

    Would this work with multiple AI? Like A horde of zombie detect you, And you kill one, Would it stop all music? Would the music start again for each zombie that detects you? Would it stop when all are killed or just one? I've implemented this in some of my other games, but can't get it working consistently.

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

    Hey Matt, quick question. I created the ai petrolling blueprints first and now i create this chase bps but my ai doesnt chase me. on see pawn doesnt and i tried to connect them but i cant. how can i do that whats the problem

  • @07532136449
    @07532136449 3 роки тому +5

    Hey, thank you for your tutorials!
    I'm currently working on a Uni project...I created my project using the Advanced Locomotion V4 in store.
    I have my enemies starting in a rag-doll state, I've followed your tutorial from there.
    My enemies don't move at all, instead they just stay in whichever state ive selected them to be in.
    I could send photos of my blueprints?
    thank you in advance :D

    • @MattAspland
      @MattAspland  3 роки тому +1

      Hey mate, one thing I'll say is, have you got a nav mesh placed down? If so, if you press "P", does the floor turn green where the AI should move?
      If both of those are yes, then yeah you can send me some screenshots of your blueprints. You can send them to my email, which can be found on my about page.
      Or you could also copy and paste your code to this website, and send the link back :)
      blueprintue.com/

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

    hey!! great tutorial but im having a problem when the enemy sees me it does play the music but it keeps restarting after every second?

  • @reeanimationgaming1034
    @reeanimationgaming1034 3 роки тому +1

    It's it bad to have all this run on tick? (also the part 2 video).. I mean, doesn't it fire off this code on every tick?

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

    I imported the base third person assets into the first person base, I believe I followed all your steps but the only thing I changed was "Cast to first person Character" instead of "cast to third person Character" but it seems the AI is not moving. Why would this be? The detection and music is fine though for some reason. anyone could help me?

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

    ok so my giant ghost sees player, chases him, he hides, chase ends.... AND I THEN MAKE THE GHOST TELEPORT TO ANOTHER FLOOR, to do this all over again, at the most inopportune time possible.
    how do i do that?

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

    One question
    How can i make to play 2 soundtracks
    1 for when he is chassing and on for when he is not chassing

  • @Mrkev217
    @Mrkev217 3 роки тому

    Noice ty

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

    Awesome bro, but I have a problem.. in my game there are 3 AI, when any of them find you it starts playing the sound I put for chase, but when two find me at the same time, the sound plays mixed :/

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

    Hi Matt thanks for the great tutorial! I was just wondering what the best way is to go about storing a reference for multiple sounds? I notice you can only use the "event begin play" method to store the singular reference. I wanted to add a noise indication to when you're detected but am unsure how you would go about storing the second reference. Thanks :)

    • @gallahad2889
      @gallahad2889 2 роки тому +2

      Disregard! Found a way to utilise an audio component attached to the character BP itself! Thanks again for your excellent tutorial i'll be back for more in future :)

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

      @@gallahad2889 please explain how you did so, currently needing a fix

  • @KGCofficial7
    @KGCofficial7 3 роки тому +1

    Is nav mesh bounds and nav mesh bounds volume the same thing?

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

    Cool. Could you make a tutorial where you do all this with your own chracter and animations?

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

      Just follow his tutorial on player animations, but do everything for the enemy instead.

  • @skellixpico
    @skellixpico 3 роки тому

    Hello! I have problem.. I do every from this tutorial but if the music start, AI isnt move.. Can u help me please? 😅

  • @chrispalmer4267
    @chrispalmer4267 3 роки тому +1

    How would you make him return to his patrol after the chase?

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

    So I followed this close, but for some reason the AI still comes after me even after I'm out of sight and the music has faded. He just doesn't stop walking. How can I fix this so when I'm out of sight, he stops moving?

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

    the audio starts instantly playing, do you know how to fix? and also doesnt stop

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

    My game uses the first person template. How would I get the blueprint for the 3rd person character?

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

    is there a way to make the ai faster while it is chasing the player?

  • @mihovilmikulec
    @mihovilmikulec 3 роки тому +1

    Is 90 degrees the maximum peripheral vision in UE? I would like my AI to have it at 360 but whatever value above 90 I enter, it still counts as 90.

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

      Brother... it's not, I guess. Cause, I've kept it as 120 degree...

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

    Hey i absolutely love this but how would i do this with a custom npc for example with a different skeleton other then the mannequin im trying to make a wendigo game and stuff and a note is that im using mixamo rig for it

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

    Hello Matt. I'm making a first person shooter game and I'm having trouble with figuring out a camera transition for a death sequence. I'm pretty new to Unreal and coding for that matter. So I've been looking around but haven't had any luck figuring this problem out. What I'm trying to do is have the player get stopped by the npc and is forced to turn towards it for a one hit kill animation. I've gotten the inputs to be disabled for my character so the npc can land on top of him, and the camera turns smoothly towards the enemy. What I'm trying figure out is a way to have the camera pan upwards as the npc jumps and lands on him. The problem is that I've used a root animation on top of my animation I made in blender so the camera doesn't track the npc's mesh as is flies towards him. It's like the first person camera refuses to move, and I don't understand how camera manager functions in telling the camera to rotate or translate. Any advice would be much appreciated.

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

      Probably already found a fix, but off-the-cuff idea might be to have it look at the NPC's head socket, or something similar.

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

    now I'm wondering if you were involved with the coding in Metroid Dread ;)

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

    can u make tutorial that when we are normally moving our heartbeat is normal but when we closer to enemy radius the heavy heartbeat plays plsssssssssssss make tutorial on this
    pls

  • @user-kp4cz4qt4i
    @user-kp4cz4qt4i 5 місяців тому

    Mine is messed up: AI is apparently player, and player cannot spawn in designated "start Spawn" area. Game freezes & unable to get out of it except restart PC.

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

    music plays 2 times almost at the same time, how to make it play only 1 time ?

  • @SanneBerkhuizen
    @SanneBerkhuizen 3 роки тому +17

    You always have "lighting needs to be rebuilt" in screen.. you really don't mind do you? 🤣

    • @MattAspland
      @MattAspland  3 роки тому +6

      Hahaha, I don't mind no lol. It's always there when you start a project so I just leave it there lol

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

      No devs wont care that unless the final build in done!

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

    how do you make the ai patrol to random places?

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

    i got an error it says accessed none trying to read property audio

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

    Hi, i watched tutorial but my enemy stands still doesnt move at all, the music plays and fades but the enemy is as still as a statue lol

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

    hey matt i love the tutorial but when the enemy chases me the chase music doesnt start, and when i stop playing i get a bunch of sound errors in error log, do you know why?

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

      this had happened to me and it was because I wasn't putting on a set in the audio. In the event begin play

  • @antoniocoronado2174
    @antoniocoronado2174 3 роки тому

    The first time that enemy chase me, if i´m too close, lets say 5-10 units, it stops chasing me and just return to random walking, even if im running in front of him and very close. If i´m far away it works perfectly. Could you help me to fix it? please!

    • @MattAspland
      @MattAspland  3 роки тому

      Hey, I've just tested mine and it appears to work all the time, even really close. So I assume we have some differences in our code somewhere. One thing I'd suggest checking is that if you select "Pawn Sensing" your AI settings are the same as mine, imaged below, and that on your "On See Pawn Event", off of the sequence you are using a "Retriggable Delay" set to 0.6, not a normal delay. Let me know of any updates.
      imgur.com/a/SDOu7Ub

  • @eggzacklee
    @eggzacklee 3 роки тому

    I did this and the roam tutorial and it worked great, but after I added your main menus and pause menu the AI just stopped working, it starts the music but the model keeps standing still. I have no idea what to do

    • @eggzacklee
      @eggzacklee 3 роки тому

      SOLVED! I had an eureka moment today on the train. I remembered putting colliders all over the map so that player cannot go over hills on fall off the cliff, and it seems that Nav Mesh Bounds Volume stopped working, so I just deleted it and imported another one, now the chasing npc works again!

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

    That air is frightening

  • @michael.corlenome
    @michael.corlenome 3 роки тому

    Hi Matt, i have a problem. When i escape from the ai the music stops playing, but he still finds me/ continues to chase me. I've re-watched the tutorial and everything is fine, but i still have the issue. Pls help!

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

      i have the same issue, i really hope he answers this

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

    my ai dont have a movement animation what i do wrong?

  • @giorgioguglielmone6528
    @giorgioguglielmone6528 3 роки тому

    I don't understand why the audio doesn't play when my character approaches the enemy.
    I followed what you said in the tutorial to the letter, but it doesn't start.

    • @MattAspland
      @MattAspland  3 роки тому

      Hi, just going to run through some troubleshooting. Do you have any audio inside of unreal, i.e. do other things also play audio? If so, does your chase audio work when opening it up and previewing it, or does the file not play at all? If you have no audio whatsoever, can you open a new project and see if it still persists, or is the issue only in this one project? Hope these can maybe help push in the right direction :)

  • @pouyanishere3392
    @pouyanishere3392 3 роки тому

    Damn it boi, where were you?!

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

    I have tried 4 diffrent tutorials but my enemy still dont want to move

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

    Can u show me how to make this Ai to move random places?

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

    I followed one of your other tutorials on roaming ai blueprints and I am trying to add this blueprint to the same AI but i cant add a new event tick mode, is there a way around this or a different node i could use?

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

      Hey! I found a way to use roam AI with this! You just need to attach the 'Random Float in Range' from the Roam AI to the Delay in this. Then after the 'Fade Out', add a 'Sequence' and attach the 'Then 0' to the 'DoOnce' and the 'Then 1' to the 'SET Is moving?' from the AI roam. Hope this helps!

  • @happycakes8469
    @happycakes8469 3 роки тому

    epic

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

    I'm loving these videos very helpful, I know this is an old one and so maybe its an issue with the updated engine, but I can get the character to chase me, but I could not add the sound effect as it would not let me add another Event to begin play node, it just zooms in on the Begin play node that is in the 3rd person blue print, anyone have any ideas how I can solve this?

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

      Ignore, I've sussed it, you don't need all that top code as its not a playable character

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

    how to make him see the player, if i am right behind him ?

  • @Gevandrow
    @Gevandrow 5 місяців тому

    how can i make it kill me when it touches me?

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

    10:00 The music is restarting to play when AI sees character second time. I have the same issue. Any ideas on how to fix that?

    • @user-rd9yn1xk4e
      @user-rd9yn1xk4e 6 місяців тому

      I had the same problem until I realized that I set the [Fade Out] link wrong into the [Do Once] I put it in the wrong nod instead of the "RESET" one. Maybe you did the same thing.

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

    Any one know why this doesn’t work when you build the project?

  • @shauryasingh6207
    @shauryasingh6207 3 роки тому +1

    I lik that one

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

    Great tutorial! But I'm having a problem. The whole thing was working perfectly until this morning, when my enemy AI randomly began to continue following me, even after I was hidden. I have no idea what could have changed. I checked and double checked the blueprint to make sure nothing is different, but I can't see any changes. Any ideas? The only thing I've done is added a new map and added some new code to the player character. (Nothing big, just a simple flashlight and a sprint input action.)

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

      I've got the same problem. Have you figured it out yet?

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

      @@Tubicaaa Not exactly. For some reason, when I placed the exact same AI characters into a new map, the problem disappeared. No clue what happened in either case, sorry.

  • @ihateyou8006
    @ihateyou8006 3 роки тому

    is there an animation graphic i can add? like a detector?
    that pops up on screen? that would be cool kinda like ghost recon wildlands.

    • @MattAspland
      @MattAspland  3 роки тому

      Hey, yeah you could have it so when the chase starts it goes "create widget>add to viewport" with a widget in that create which is what you like, maybe some text. Then when the chase ends, get a reference to this widget and get "Remove from parent". Hope this helps, let me know if you need a hand with it :)

  • @WaveWonder1
    @WaveWonder1 3 роки тому

    My AI can't seem to lose me? As soon as it sees me, it follows me even if I escape its line of sight?

    • @MattAspland
      @MattAspland  3 роки тому

      Ah okay, this could be a number of things, so could you maybe copy and paste your code to this website and send it here again? That way I can take a proper look for you :)
      blueprintue.com/

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

    Ahh I thought he was gonna play flight of the bumble bee!

  • @firstgamerable
    @firstgamerable 3 роки тому

    You should do a stealth tutorial (e.x Hiding under a table to avoid AI's detection) :)

    • @MattAspland
      @MattAspland  3 роки тому +1

      Hey, great idea. I did one for hiding in a locker which you might like? All the best to you :)
      ua-cam.com/video/gHJ4pHlqAzQ/v-deo.html

    • @firstgamerable
      @firstgamerable 3 роки тому +1

      @@MattAspland I loved it, but is it possible to not get detected by an AI whilst hiding in it? :)

    • @MattAspland
      @MattAspland  3 роки тому

      @@firstgamerable Yeah, when we set the actor to be hidden in game, it shouldn't be able to spot you, this worked for me. Does the AI still see you with that?

    • @firstgamerable
      @firstgamerable 3 роки тому +1

      @@MattAspland I've actually followed your bed-hiding tutorial. The hiding mechanism did actually worked, but the AI can still see me, weird.

    • @MattAspland
      @MattAspland  3 роки тому

      @@firstgamerable Oh that is weird, and your character is definitely set to be hidden in game right?

  • @kogayokai
    @kogayokai 3 роки тому

    the script stopped working for no reason, can anyone help?

  • @sour_gamer_1
    @sour_gamer_1 3 роки тому

    Great tutorial, but im having an issue, the music plays when I get chased, but then dosent stop when im out of sight... Can I pls have help....

    • @sour_gamer_1
      @sour_gamer_1 3 роки тому

      NVM i forgot to connect the flase branch to the fade out... im new to this

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

    Could you make a tutorial for an AI that opens doors. Ty

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

    how to fix it (accessed none trying to read property audio) ?

    • @sam-fe2ul
      @sam-fe2ul Рік тому +1

      I have the same problem

    • @sam-fe2ul
      @sam-fe2ul Рік тому +4

      Help us please 🙏🥺

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

    the fact is because you havent put any stairs to your level then the enemy doesnt really stops seing you, its because you are not reachable that the ennemy stops following you. In reality, the ennemy stills follows you but because you are not reachable it stops the function. I need to make it stops running to me when there is a wall that hides me

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

      yes that's the trick he used for this tutorial😁😁😁

  • @DirtyPoopers
    @DirtyPoopers 3 роки тому

    Great stuff!
    I've watched and followed a few methods of enemy detection.
    I will no lie Venmo you $40 if you do a behavior tree.
    I've seen a few but still get confused

    • @MattAspland
      @MattAspland  3 роки тому +1

      Thank you!
      I can definitely look into doing a behaviour tree tutorial yeah, I'll add it to my list thank you :)

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

    i dont know what im doing wrong, But for the main part it works flawlessly! but when the audio fades out and im clearly out of sight, the ai still chases me. Im going to have to figure that out haha

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

      I think, it is because the AIMoveTo function does not stop until it gets to your position or is not able to get there (like you are out of nav mesh). Anyway to fix it, try to call StopActiveMovement function on AI character, when you stop music.

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

    Thank you for the great tutorial!
    I have a small issue where the AI still follows me even after it hasn't seen me for over 2 seconds. The music stops too but the AI still chases. When it sees me again the music starts again. Does anyone have an idea why this could be?

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

      Well, I fixed that issue by replacing the ''event tick'' by a custom even called ''Stop Chase''. I then called ''Stop Chase'' after the Retriggerable Delay.
      I also added ''Stop Active Movement'' after the Fade out music and called back my patrol event.
      That way my AI return to patrol and stop following you everywhere.

    • @Linus_YouTube
      @Linus_YouTube 2 роки тому +2

      @@ztormsink5931 Thank you for your suggestion, I was able to solve the problem. As someone else suggested, the "AI Move To" doesn't stop the action until the target point/object is reached. To stop the action I just used "Stop Active Movement (Target is Nav Movement Component)" and plugged "self" (in the AI Blueprint) into it. I used this before "Fade Out" and it worked! When the AI sees me again, it starts chasing again.

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

      @@Linus_UA-cam I had the same issue and did what you said fixed it, and it worked for me too! I just plugged it in at the end of the *CanSeeEnemy False* Segment of the code, and it worked like a charm!

  • @ElitUtik
    @ElitUtik 3 роки тому

    Bro can u make replicated version pls.

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

    get ref to self does not work :(

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

    My enemy never stops chasing the player

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

    dont lose your time , in new version of UE4 , "self" cant be linked to "AI Move To"

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

    One question how can i change the speed of the enemy?

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

      hi, I'm happy you didn't ask this question long ago cause I just found the answer. You just have to drag the character movement component, get it, then pull a Set Max Walk Speed from it and plug the Set speed in the event begin play. I plugged it before the audio component but I don't think it matters :)

  • @channelmoved3114
    @channelmoved3114 3 роки тому

    I don't know why, the music part works but it doesn't chase me?

    • @channelmoved3114
      @channelmoved3114 3 роки тому

      Never mind mate, I've done it, bangin tutorial.

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

    hey, thank you for the tutorial. However, I am having an issue where the music is played over and over for each enemy. For one enemy is works fine, but for multiple enemies, it plays multiple copies of the music also.

    • @xantishayde-walker4593
      @xantishayde-walker4593 2 роки тому +4

      You're probably going to have to remove the code for playing the music from the Enemy AI and set up something in the Level BP instead that starts playing the music when the Can See Player Bool switches to true. I'm not 100% sure how to do this so you're probably on your own on that one. Good luck though.

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

      @@xantishayde-walker4593 Thanks, yeah I tried that also haha. I have the code in the level bp, and it's called when the pawn senses the player. I'll figure something out

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

      @@Davey123able hey man not sure if you figured this out but you could try adding a valid check before the music starts, if it's not valid create the music and if it is valid then continue with the code?

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

      @@BearyK8 Hey, I believe I had tried that before, but I have just switched entirely to a different system like most traditional mmorpgs. So when the weapon is drawn, the combat music starts and vice versa. Makes it a lot more easier in my opinion, although not as dynamic

  • @GoofyRiderFilms
    @GoofyRiderFilms 3 роки тому

    I'm gonna try this, I want the pawn sensing to be like a viewcone. I want to make a stealth game, even though it's just my second day in UE4. Do you think I'll be be able to do it ? :D

    • @MattAspland
      @MattAspland  3 роки тому +2

      Hey, of course. You can do anything you set your mind to, if you put in the work and determination, I'm sure you'll do it! I wish you all the best of luck :)

    • @GoofyRiderFilms
      @GoofyRiderFilms 3 роки тому +1

      @@MattAspland Thanks!

    • @MattAspland
      @MattAspland  3 роки тому

      @@GoofyRiderFilms No problem, good luck and I'm always here to help :)