Тёмный

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

Matt Aspland
Подписаться 80 тыс.
Просмотров 72 тыс.
50% 1

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

Опубликовано:

 

11 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 244   
@MattAspland
@MattAspland 3 года назад
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 года назад
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 года назад
@@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
@cinomontague
@cinomontague 3 года назад
These are by far the best Unreal Engine tutorials I've found and I've been searching night and day
@MattAspland
@MattAspland 3 года назад
Thanks so much man! Always happy to help! :)
@supclips4054
@supclips4054 2 года назад
On god
@gangstahamsta3885
@gangstahamsta3885 2 года назад
true
@squarerootof2
@squarerootof2 Год назад
Your search is now over my son. You have reached your final destination, total enlightenment and immortality...
@Noobsed
@Noobsed 2 года назад
Thank god, I was searching this tutorial for day
@GaryParkin
@GaryParkin 3 года назад
I didn't know you could do all this without the behavior tree. Wow, thank you.
@MattAspland
@MattAspland 3 года назад
Yep, I find it easier to understand like this. No problem :)
@giancalabrese
@giancalabrese 3 года назад
You are a legend, thanks for these tutorials!
@MattAspland
@MattAspland 3 года назад
Thank you man, no problem, happy to help! :)
@timsonss
@timsonss 3 года назад
Lets goooo great as always my man
@MattAspland
@MattAspland 3 года назад
Thank you so much! :)
@tacticalsamurai8
@tacticalsamurai8 3 года назад
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 :)
@yoy4536
@yoy4536 2 года назад
thanks i really like your videos you help me a lot
@nassergreatdeveloper3745
@nassergreatdeveloper3745 Год назад
Thank you man
@highlywired2675
@highlywired2675 Год назад
Amazing tutorial!! It's so creepy
@aleksboboychev
@aleksboboychev 10 месяцев назад
Thank you!
@deridionentertainment
@deridionentertainment 2 года назад
Amazing. I love you video
@ravenx116
@ravenx116 3 года назад
literally first working tutorial on ai
@grandcheezex5430
@grandcheezex5430 Год назад
you are awesome, helped me so much for my class lol
@MattAspland
@MattAspland Год назад
Glad I could help!
@abdullahsohail5395
@abdullahsohail5395 3 года назад
Thanks for making that video it will help me alot me in horror game liked your video
@MattAspland
@MattAspland 3 года назад
No problem, happy to help :)
@yucelb
@yucelb 3 года назад
awesome thank you matt :)
@MattAspland
@MattAspland 3 года назад
Thank you and no problem man :)
@solideogloria5553
@solideogloria5553 Год назад
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
@BenTheDev
@BenTheDev Год назад
THANK YOU!!!!!
@shortsadventure6323
@shortsadventure6323 2 года назад
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?
@varundoshi5136
@varundoshi5136 3 года назад
Brilliant tutorial
@MattAspland
@MattAspland 3 года назад
Thank you so much!
@babapeer1651
@babapeer1651 3 года назад
Thanks it works
@TheTrueAlpha-gx6iv
@TheTrueAlpha-gx6iv Год назад
this is a great tutorial! This is one step for me on my backrooms game!
@LightningWebGames
@LightningWebGames Год назад
I hope you succeed!
@erykbugajski7747
@erykbugajski7747 3 года назад
Hey great tutorial. Is there any way to lower the volume of the music?
@waitisthatcobalt
@waitisthatcobalt 2 года назад
Nice tutorial bruh, I like the Metal Gear Solid wannabe chase music lmaoooo
@wates123
@wates123 Год назад
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
@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
@Alex00m
@Alex00m 3 года назад
Yes😁 Do more AI stuff, iam waiting for behavior tree😁😁
@MattAspland
@MattAspland 3 года назад
Thank you, I'll hopefully get around to it, but I plan on doing more definitely :)
@Si-Toecutter
@Si-Toecutter 3 года назад
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 2 года назад
@@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.
@gamingarc1067
@gamingarc1067 2 года назад
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 Год назад
@@Balkor glad I could help!
@Mrkev217
@Mrkev217 3 года назад
Noice ty
@MattAspland
@MattAspland 3 года назад
Thank you and no problem :)
@timsonss
@timsonss 3 года назад
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 года назад
Hey, of course yeah, I can look into that :)
@MrMingles
@MrMingles 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?
@greaver5470
@greaver5470 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.
@chadrat5129
@chadrat5129 Год назад
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?
@pouyanishere3392
@pouyanishere3392 3 года назад
Damn it boi, where were you?!
@mackdiamond5805
@mackdiamond5805 Год назад
the audio starts instantly playing, do you know how to fix? and also doesnt stop
@KGCofficial7
@KGCofficial7 3 года назад
Is nav mesh bounds and nav mesh bounds volume the same thing?
@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
@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
@atlerre6969
@atlerre6969 2 года назад
That air is frightening
@primitivepatterns
@primitivepatterns 2 года назад
now I'm wondering if you were involved with the coding in Metroid Dread ;)
@UnsealedWings
@UnsealedWings 3 года назад
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.
@SanneBerkhuizen
@SanneBerkhuizen 3 года назад
You always have "lighting needs to be rebuilt" in screen.. you really don't mind do you? 🤣
@MattAspland
@MattAspland 3 года назад
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!
@imZANETTI
@imZANETTI Год назад
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 :/
@reeanimationgaming1034
@reeanimationgaming1034 3 года назад
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?
@thatdudepeter
@thatdudepeter Год назад
is there a way to make the ai faster while it is chasing the player?
@07532136449
@07532136449 3 года назад
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 года назад
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/
@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.
@onurshakir6041
@onurshakir6041 Год назад
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?
@SyTheRed
@SyTheRed Год назад
My game uses the first person template. How would I get the blueprint for the 3rd person character?
@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
@khataranakgamerboy
@khataranakgamerboy Год назад
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
@happycakes8469
@happycakes8469 3 года назад
epic
@chrispalmer4267
@chrispalmer4267 3 года назад
How would you make him return to his patrol after the chase?
@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?
@shauryasingh6207
@shauryasingh6207 3 года назад
I lik that one
@MattAspland
@MattAspland 3 года назад
Thank you! :)
@ReubenAStern
@ReubenAStern Год назад
Ahh I thought he was gonna play flight of the bumble bee!
@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 года назад
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
@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
@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.
@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!
@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? 😅
@DavidMaclin351
@DavidMaclin351 Год назад
My enemy never stops chasing the player
@northland547
@northland547 Год назад
music plays 2 times almost at the same time, how to make it play only 1 time ?
@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?
@KondixOfficial
@KondixOfficial Год назад
Can u show me how to make this Ai to move random places?
@dabruhlol7097
@dabruhlol7097 2 года назад
how do you make the ai patrol to random places?
@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.
@mihovilmikulec
@mihovilmikulec 3 года назад
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.
@raktim_org
@raktim_org 2 года назад
Brother... it's not, I guess. Cause, I've kept it as 120 degree...
@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
@x6ledateditor
@x6ledateditor 2 года назад
i got an error it says accessed none trying to read property audio
@firstgamerable
@firstgamerable 3 года назад
You should do a stealth tutorial (e.x Hiding under a table to avoid AI's detection) :)
@MattAspland
@MattAspland 3 года назад
Hey, great idea. I did one for hiding in a locker which you might like? All the best to you :) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gHJ4pHlqAzQ.html
@firstgamerable
@firstgamerable 3 года назад
@@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 года назад
@@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?
@MrMingles
@MrMingles 2 года назад
This reminds me a lot of hello neighbor.
@Gevandrow
@Gevandrow 5 месяцев назад
how can i make it kill me when it touches me?
@elli3663
@elli3663 Год назад
how to fix it (accessed none trying to read property audio) ?
@sam-fe2ul
@sam-fe2ul Год назад
I have the same problem
@sam-fe2ul
@sam-fe2ul Год назад
Help us please 🙏🥺
@LeisaTheGreat
@LeisaTheGreat 2 года назад
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.
@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
@jmm1449
@jmm1449 Год назад
Could you make a tutorial for an AI that opens doors. Ty
@MrTerrorM
@MrTerrorM 2 года назад
how to make him see the player, if i am right behind him ?
@Prydario
@Prydario 2 года назад
my ai dont have a movement animation what i do wrong?
@mr_xbox3603
@mr_xbox3603 2 года назад
I have tried 4 diffrent tutorials but my enemy still dont want to move
@danielsoto5494
@danielsoto5494 10 месяцев назад
Any one know why this doesn’t work when you build the project?
@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 :)
@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!
@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 5 месяцев назад
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.
@gameisolation
@gameisolation 4 месяца назад
Great tutorial but my character does not move
@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
@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 :)
@ElitUtik
@ElitUtik 3 года назад
Bro can u make replicated version pls.
@michael.corlenome
@michael.corlenome 2 года назад
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 года назад
i have the same issue, i really hope he answers this
@sour_gamer_1
@sour_gamer_1 2 года назад
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 2 года назад
NVM i forgot to connect the flase branch to the fade out... im new to this
@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 года назад
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 года назад
@@MattAspland Thanks!
@MattAspland
@MattAspland 3 года назад
@@GoofyRiderFilms No problem, good luck and I'm always here to help :)
@Linus_YouTube
@Linus_YouTube 2 года назад
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 года назад
@@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 года назад
@@Linus_RU-vid 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!
@autodriv3r405
@autodriv3r405 Год назад
get ref to self does not work :(
@Purrxz
@Purrxz Год назад
does it kill 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 года назад
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.
@Davey123able
@Davey123able 2 года назад
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 года назад
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
@kogayokai
@kogayokai 3 года назад
the script stopped working for no reason, can anyone help?
@ryanarmstrong6512
@ryanarmstrong6512 3 года назад
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. Also great video brother.
@nauseatingrev5034
@nauseatingrev5034 Год назад
Let me know if you figured out why! 😅
@onurshakir6041
@onurshakir6041 Год назад
@@nauseatingrev5034 you know the answer? because I got the same problem
@nauseatingrev5034
@nauseatingrev5034 Год назад
@@onurshakir6041 it was a small error, I had my nav mesh too low, so I raised it up bit by bit whilst spamming ‘P’ to see the green light which would then mean they are able to move in that area now
@nauseatingrev5034
@nauseatingrev5034 Год назад
@@onurshakir6041 possibly you need to move your nav mesh bounds a little higher or a little lower
@onurshakir6041
@onurshakir6041 Год назад
@@nauseatingrev5034 thanks
@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/
@RushGunner
@RushGunner 3 года назад
If we make multiple copy of AI actor, it is making 4 sounds overlaping at once
@AntonioFreyre
@AntonioFreyre 3 года назад
make the audio a sound cue and use that instead of the wav, then in sound cue option in concurrency set it to 1
@MattAspland
@MattAspland 3 года назад
Yeah that should work, thank you Antonio. If it doesn't, let us know :)
@candymangames5022
@candymangames5022 3 года назад
@@AntonioFreyre This did the trick! thanks
@tiptoetopia8449
@tiptoetopia8449 3 года назад
How do you make it a sound cue? :)
@sydmuzammilali2000
@sydmuzammilali2000 3 года назад
@@tiptoetopia8449 Right click on audio and click create cue
Далее
Хотите поиграть в такую?😄
00:16
Просмотров 189 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 3,9 млн
Hello Neighbor UE4 AI Tutorial #1 | Chase and Catch
13:38
Make your door open away from the player | UE 5
13:37