If anyone has a set destination error, follow these steps 1. Select your ground and check static on the top right corner of the inspector. 2. Keep your ground selected, and go to the Navigation tab. (Window>AI>Navigation) Then you should see a tab in Navigation called bake. Select it, and click bake on the bottom. 3. Play test your game. It might work it might not. If it doesn't work, follow the next steps. If it does, you are good to go. 4. Move your enemy ai closer to the ground. 5. Play test your game again. It might work it might not. If it doesn't work, follow the next steps. If it does, you are good to go. 6. If your enemy gets stuck in the ground, select your enemy, and in the NavMeshAgent, play around with the base offset. You should see a cylinder. Make that cylinder touch the ground.
@minecraftmadlad35934 жыл бұрын
Thanks so much lol
@TheSecretSause4 жыл бұрын
ya thank you
@laurisdupois82754 жыл бұрын
Thanks !!
@sealclips72364 жыл бұрын
Thank you so much!
@dcengiz404 жыл бұрын
thanks a lot
@LeonardoSilvaHavelock7 жыл бұрын
Dude, what you do on youtube.. teaches people for free is just too much...,I'm very grateful to you, all my skills with unity and even learning English I'm getting into these classes, thank you.
@James-zr1lu6 жыл бұрын
Technically it isn't free. The video is monetized by ads. So, it costs you your time.
@AMBafoon6 жыл бұрын
James which is more valuable than money if you think about it
@gorgestboi10285 жыл бұрын
@Big Smoke PINEAPPLE ON PIZZA IS AMAZING
@mainaody39975 жыл бұрын
@@andrewnagengast2349 the pineapples on pizza part got me lol
@pitanga17244 жыл бұрын
Mds, achei um BR! Aleluia!!!
@Yonac5 жыл бұрын
"if we get closer to our enemy, it will start to chase us, *AWESOME* "
@__Rizzler__4 жыл бұрын
"Hehe boi u have got some knowledge" - words of an old dog
@s4mcreed3147 жыл бұрын
My days goes awesome when he says "AWESOME!"
@nirangasithara49253 жыл бұрын
After all these years I still come back to your videos..... Awesome Job my man !!! Mad Respect !!!
@ContinualImprovement7 жыл бұрын
Man, I love your videos. Especially these RPG ones 👌
@finanzenkeine4 жыл бұрын
mate you are simply the best everytime i watch a tutorial elsewhere they jugle theyre scripts between episodes so that you have to watch every of theyre episodes but you do a complete video where you explain everything regarding one topic. i love your videos :) you are the best mate keep up the good work you made my day
@rhetorical_7 жыл бұрын
Man, thank you for making these tutorials! They're top notch quality and very interesting! Keep it up!
@dascience11472 жыл бұрын
yes
@dprazo4 ай бұрын
6 years later and this video is still doing better than most recent videos
@spook27944 жыл бұрын
im getting an error: "SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3) EnemyController:Update() (at Assets/EnemyController.cs:25)
@Floyna4 жыл бұрын
Bake the map again (Map > Navigation > Bake > Bake) Or put your Enemy more close to the map
@cristianbustillo47604 жыл бұрын
@@Floyna thx
@bobdagamer6404 жыл бұрын
I’ve hit bake and nothing happened
@zzedixx4 жыл бұрын
@@Floyna where is the "map" tab??
@Floyna4 жыл бұрын
It's the map you use to move you're character You can locate it on you're Scene Sorry guys i'm late :o The method I gave is not universal but maybe it's work for you
@beastninja56553 жыл бұрын
7:32 The type or namespace name 'Interactable' could not be found (are you missing a using directive or an assembly reference?), I am getting this error
@mosaabmatar41173 жыл бұрын
Same here There is no class Named Interactable Its maybe Changed
@codingTheFuture6 жыл бұрын
Love this series. It's been a great help with my current project. Keep the coming!
@averagehumanbeing79323 жыл бұрын
when you just want a simple enemy ai and then have to spend a few hours watching his entire series, only for it to break your game
@sevendarsh40823 жыл бұрын
lol
@codemoor6 жыл бұрын
The type or namespace name 'Interactable' could not be found (are you missing a using directive or an assembly reference?) The type or namespace name 'Interactable' could not be found (are you missing a using directive or an assembly reference?) how can i fix it §?
@amsyarsyahrizal64234 жыл бұрын
Sorry I'm a bit late, but to anyone else who has this problem: Make sure to watch this video first --kzbin.info/www/bejne/b6XIga2vgZuXncU
@firepuppy72114 жыл бұрын
i can help u if u still want it
@bluedonnut_80964 жыл бұрын
The type or namespace name 'CharacterCombat' could not be found (are you missing a using directive or an assembly reference?) The type or namespace name 'CharacterCombat' could not be found (are you missing a using directive or an assembly reference?) please help
@_CloudyBunny5 жыл бұрын
Let's start to create deep-learning AI enemy.
@thebloocat4 жыл бұрын
Yeah! You know any good resources for that?
@arneljansarmiento5 жыл бұрын
just discovered this series now im trying to integrate the parts of these scripts with your tower defense tutorial series to make a 3d kingdom rush type of game, thank a lot for these vids. btw im so new to game development so im really grateful
@davidcheung99393 жыл бұрын
For some reason Unity shows an error when I try to do Enemy : Interactable...is there a way to fix the interactable error here?
@nicpotoplyak82593 жыл бұрын
same here did you find a fix?
@majesticmaniac64204 жыл бұрын
if anyone else had the thing that said "SetDestination can only be called on an active agent that is on a NavMesh." I set the ground as static went to window- AI- Navigation then bakedif that helps
@damienarchaglet80885 жыл бұрын
i keep getting this error "SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3) EnemyController:Update() (at Assets/EnemyController.cs:25)
@DrSTew-qt1mm5 жыл бұрын
same
@kerlonleite19275 жыл бұрын
Same.. Any solutions ?
@theforgot3n15 жыл бұрын
Maybe you NavMeshAgent is inactive? Or you forgot to add the component to the cube?
@arcadeboy75035 жыл бұрын
You go to Window>AI>Navigation and once you have the navigation window open, click on the objects that you want to bake a NavMesh and in the bake tab click bake. Hope this helps!
@pleckton29724 жыл бұрын
@@arcadeboy7503 Thannkksss
@tssper34884 жыл бұрын
I'm stiil wondering how to 'collapse' when using regions in the c# scripts. I looked up keyboard shortcuts but nothing helps. Somebody pleasre help...
@najeeburrehman33034 жыл бұрын
there is a - sign in leftside where the region starts click it
@tssper34884 жыл бұрын
Najeeb Ur Rehman Oh ok thanks, helps a lot
@VoltFall4 жыл бұрын
@@tssper3488 maybe you should look closer
@parkerhall94704 жыл бұрын
it is Control + M + M I think?
@Ecoustic4 жыл бұрын
Lol me too
@tombecker11974 жыл бұрын
Assets\scripts\Enemy.cs(5,22): error CS0246: The type or namespace name 'Interactable' could not be found (are you missing a using directive or an assembly reference?) what am i doing wrong pls answer this time
@Fishing-vr7eh3 жыл бұрын
Pry a spelling error
@coolgamingmaster25787 жыл бұрын
Can someone help me? I have a problem with the nav mesh agent. I checked my script to be like brackeys' but it don't work. Unity says: SetDestination can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3)
@luisguilherme2167 жыл бұрын
i have the same problema!! please help !!
@coolgamingmaster25787 жыл бұрын
sumerian ozzyz i fixed it. Make a group for the floor and go to window then navigation and its gonna open a bonus window next to the inspector. Then go to objects select mesh renderer and select the floor group(the y axis should be the same) then do this group static - yes for all children and then go back to navigation and bake the floor. Ask if you havent understand
@luisguilherme2167 жыл бұрын
im trying thanks
@luisguilherme2167 жыл бұрын
its done but now it appears object reference not set to an instance of na objetc .. : s
@coolgamingmaster25787 жыл бұрын
have you dragged it into the inspector (when you create for example public GameObject player you need to drag the object - the player in the inspector)
@SuperPizdolizac7 жыл бұрын
I can't believe how good you are at explaining!
@pedrogll60524 жыл бұрын
"SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3) EnemyController:Update() (at Assets/EnemyController.cs:27) can someone help me?
@monkeyballs1884 жыл бұрын
generate a navmesh for your floor
@mateodemicheli24204 жыл бұрын
@@monkeyballs188 How i do that? In my Console apears this : "SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3) AgarrameSiPodes:Update() (at Assets/AgarrameSiPodes.cs:38) Pleas answer the soon as you can :c
@benmohrland4 жыл бұрын
I also got this error. I think I fixed it by placing my character on the ground or at least closer to it.
@chosengames41724 жыл бұрын
@@mateodemicheli2420 Go to the windows tab at the top and find the navigation panel(should be in the AI section). Then click over to the bake tab and bake.
@MycoalD4 жыл бұрын
@@chosengames4172 thank you sooooo much
@omnigulwillofcrota83916 жыл бұрын
Great tutorial as always! Easy to follow and really helped me out except for the fact that it doesn't work. I keep getting this error: Failed to create agent because it is not close enough to the NavMesh. Then whenever I get in range i get this error : "SetDestination" can only be called on an active agent that has been placed on a NavMesh. Anybody know what to do? I already baked the floor and stuff.
@Hadidiz5 жыл бұрын
i had this problem but when i baked the terrain it worked smoothly
@freeradical90113 жыл бұрын
Yes bro I got the same error....
@valorantworld88953 жыл бұрын
6:45 why slerp, and not lerp? i know that slerp makes spherical path to the target, but i made 2 ai agents, and put lerp in one and slerp in the other, and saw no difference, it worked nice for me, but i just want to know why, ty Brackeys
@breewilkinson87874 жыл бұрын
Not to sure why but my target location isnt updated after start. So the enemy will move to the initial player position but not follow the player after the player moves (or if the player is out of the lookRadius). I followed the video, any suggestions?
@scottev9545 жыл бұрын
Great info on NavMeshes... I was able to get the right information quickly and easily!! Thank you for all of your tutorials.
@anhky20107 жыл бұрын
Thank you so much, Brackeys! I am looking forward to the next part! :D
@BerwinSingh4 жыл бұрын
I am getting an error "Set Destination" can only be called on an active agent that has been placed on the NavMesh. UnityEngine.AI.NavMesh:SetDestination(Vector3). How to fix this and what is the mistake? Please help me.
@Noir-mt3bw4 жыл бұрын
Berwin Singh i have this too.
@meltpack88767 жыл бұрын
When everyone makes half hour long ai vids but ya boi asbjørn got ai down
@ateKna7 жыл бұрын
@Brackeys How do I point to my player that I spawned at runtime? I can't use the public method player that you show in the tutorial.
@raivologins92993 жыл бұрын
I like that u speak fast and dont waste our time 👊👊👊
@thatrandomguy85676 жыл бұрын
I got this error "SetDestination" can only be callrd on an active agent that has been placed onna NavMesh. Any help?
@ashothayrapetyan98285 жыл бұрын
@@juniorasare9769 Thank you
@overwhelming92125 жыл бұрын
@@juniorasare9769 Hey I dont understand this part " open the navigation window, select the floor, go on object and turn on navigation static" could you help me out pls
@Aswll5 жыл бұрын
@@overwhelming9212 any obstacles or walls you have set it as "Navigation Static" on the inspector (top right corner). In Unity, NavMesh generation is handled from the Navigation window (menu: Window > AI > Navigation). Do the same with the Enemy AI object. I think. Try it and let me know if it worked!
@Aswll5 жыл бұрын
@@overwhelming9212 also bake them
@Adkinsy855 жыл бұрын
@@juniorasare9769 thank you ❤️
@closed90095 жыл бұрын
error CS0506: 'Enemy.Interact()': cannot override inherited member 'Interactable.Interact()' because it is not marked virtual, abstract, or override help!
@Corez5 жыл бұрын
Have you made a function for it?
@burpybirb5 жыл бұрын
Who else got a little spooked when he suddenly plays the music
@abdelrhmanmagdey3346 жыл бұрын
Can you help me , An error appear says ""SetDestination" can only be called on an active agent that has been placed on a NavMesh"
@gaddgames4 жыл бұрын
same
@mr_moon23744 жыл бұрын
@@gaddgames you go to the windows tab then head to ai then navigation. go to objects then click on your ground then press navigation static. then go back to the bake tab and hit bake. hope that helps
@loucypatucy59744 жыл бұрын
for me when i write OnDrawGizmosSelected it pops up a warning that the (OnDrawGizmosSelected) is declared but never used pls someone help
@ZaCool265 жыл бұрын
Can someone help. I keep getting this error: "Failed to create agent because there is no valid NavMesh". I've tried baking it but it still doesn't work! What is wrong???????????
@icoderunity50664 жыл бұрын
hello, to make this work you need to set your ground to static(and your obstacles) then bake turn off Auto lightning if still doesn't and set your obstacles in the scene as "Navmesh Obstacles".
@ZaCool264 жыл бұрын
icoder Unity Thanks 🙏🏻 it works now 😄
@icoderunity50664 жыл бұрын
No problem, i had that issue too. :)
@BRboi7777 жыл бұрын
Wow what a great channel this is. I've been subbed for sometime and coding interests me. Thanks for the awesome channel! :)
@JShunk4 жыл бұрын
I’m getting the error “MissingComponentException: There is no ‘NavMeshAgent’ attached you the “Enemy” game object, but script is trying to access it.” Any way to fix this?
@matthewbrown9954 жыл бұрын
add NavMeshAgent to Enemy if you haven't already
@JShunk4 жыл бұрын
Got it thanks!
@Sam-dn9lj5 жыл бұрын
I was wondering if anyone could help me on my problem. I have typed in all of the code up to 5:35 and I attempted to run the code and I got this error: "Failed to create agent because there is no valid NavMesh" My player has a NavMeshAgent component on it, so I am not sure what I am doing wrong. Thanks.
@lionn00b5 жыл бұрын
@@juniorasare9769 Thank you!! this helped
@adarshs59746 жыл бұрын
Why is he always Smiling?
@kieranmahon96876 жыл бұрын
Adarsh s because he is happy helping us
@ezpz46466 жыл бұрын
Adarsh s Lol
@rahultech21776 жыл бұрын
@@ezpz4646 yak
@Driesipops4 жыл бұрын
the sniper would be angry if he didnt
@awesomeskelly28854 жыл бұрын
it woudnt look good if he was frowning
@Joseph-mt3iw5 жыл бұрын
I have one problem and it's : NullReferenceException: Object reference not set to an instance of an object EnemyController.Update () (at Assets/Scripts/Controllers/EnemyController.cs:22) can someone help me please ?
@melonmuncher91665 жыл бұрын
same
@josephkelly30446 жыл бұрын
I tried to attempt this but form some reason I keep getting two errors: NullReferenceException: Object reference not set to an instance of an object EnemyController.Start () (at Assets/Scripts/Controllers/EnemyController.cs:15) NullReferenceException: Object reference not set to an instance of an object EnemyController.Update () (at Assets/Scripts/Controllers/EnemyController.cs:22) Anybody have any idea whats wrong?
@trallaton6 жыл бұрын
You ever figure out what was wrong?
@trallaton6 жыл бұрын
I have it fixed. Apparently the Awake function just wasn't capitalized.
@trallaton4 жыл бұрын
@Yaq I got you fam
@patiimusic37014 жыл бұрын
I'm very new at this, so I don't know if you've answered this b4 but how do you make the enemy have an angle for line of sight
@oc94386 жыл бұрын
just a great tutorial overall, even though I cannot donate currently I will be sure to share your channel as much as possible
@opreaandrei40123 жыл бұрын
any ideea why my enemy is coming exactly into me , i mean after he reaches me he stays exactly where i am ( on top of me ) and i cant move . If i put a rigidbody on him , after he reaches me and i attack him or he just touches me he go away and never come back xD . Any help pls ?
@dron57343 жыл бұрын
did you changed "stopping distance" in navMeshAgent component?
@opreaandrei40123 жыл бұрын
@@dron5734 I tried but not working so well
@Greed-ms2cv6 жыл бұрын
Thank you for your videos! But i encounter some problem. It is working. but when i put a new enemy not the first one. there's an error "SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3) enemyController:Update() (at Assets/enemyController.cs:35) It is the same as the first enemy it have rigidbody, navmesh agent and the scripts that works in the first enemy . somebody help me :3
@1zc56 жыл бұрын
I have a script that can help you!!! this script using UnityEngine; using UnityStandardAssets.Characters.FirstPerson; using UnityEngine.AI; public class AiExample : MonoBehaviour { public enum WanderType { Random, Waypoint }; public float damage = 16f; public GameObject fpsc; public WanderType wanderType = WanderType.Random; public float wanderSpeed = 4f; public float chaseSpeed = 7f; public float fov = 120f; private bool isAware = false; private Vector3 wanderPoint; public Transform[] waypoints; private bool Attacking = false; public GameObject radgollZombie; public GameObject NPC; [SerializeField] private float health = 100f; public float viewDistance = 10f; private NavMeshAgent agent; private Renderer renderer; public float wanderRadius = 7f; private int wayPointIndex = 0; private Animator anim; public void Start() { agent = GetComponent(); renderer = GetComponent(); wanderPoint = RandomWanderPoint(); anim = GetComponentInChildren(); } public void Update() { if (isAware) { agent.SetDestination(fpsc.transform.position); anim.SetBool("Aware", true); agent.speed = chaseSpeed; //renderer.material.color = Color.red; } else { SearchForPlayer(); wander(); anim.SetBool("Aware", false); agent.speed = wanderSpeed; //renderer.material.color = Color.green; } } private void OnTriggerEnter(Collider other) { if (hit.GetComponent()) { GetComponent().ApplyDamage(damage); } Attacking = true; anim.SetTrigger("Attack"); } private void OnTriggerExit(Collider other) { Attacking = false; } public void SearchForPlayer() { if (Vector3.Angle(Vector3.forward, transform.InverseTransformPoint(fpsc.transform.position)) < fov / 2f) { if (Vector3.Distance(fpsc.transform.position, transform.position) < viewDistance) { RaycastHit hit; if (Physics.Linecast(transform.position, fpsc.transform.position, out hit, -1)) { if (hit.transform.CompareTag("Player")) { OnAware(); } } } } } public void OnAware() { isAware = true; } public void wander() { if (wanderType == WanderType.Random) { if (Vector3.Distance(transform.position, wanderPoint) < 2.5f) { wanderPoint = RandomWanderPoint(); } else { agent.SetDestination(wanderPoint); } } else { if (waypoints.Length >= 2) { if (Vector3.Distance(waypoints[wayPointIndex].position, transform.position) < 2f) { if (wayPointIndex == waypoints.Length - 1) { wayPointIndex = 0; } else { wayPointIndex++; } } else { agent.SetDestination(waypoints[wayPointIndex].position); } } { Debug.LogWarning("Please Assign more than 1 waypoint to the me!!" + gameObject.name); } } } public Vector3 RandomWanderPoint() { Vector3 randomPoint = (Random.insideUnitSphere * wanderRadius) + transform.position; NavMeshHit navHit; NavMesh.SamplePosition(randomPoint, out navHit, wanderRadius, -1); return new Vector3(navHit.position.x, transform.position.y, navHit.position.z); } public void ApplyDamage(float damage) { health -= damage; if (health
@finlayf54326 жыл бұрын
@Yaman what should I drag into the NPC ragdoll zombie and Fpsc ? And thanks for the script
@1zc56 жыл бұрын
Finlay Fulton drag a prefab that look exactly like the model you are using as a enemy then exclude it from any thing attached to it except the rigid body meaning you need to remove the animator and the Ai script then make it rag doll by right clicking it in the hierchey and press 3D model then press rag doll and assign the bones to it for the fpsc just drag the playable character to it Edit: btw when you make it rag doll and making it as a oregano drag it to the zombie rag doll sorry for calling it zombie but because I was using it for my zombie game
@dong-kunlee53955 жыл бұрын
Check "navmeshagent.enable = true;:" maybe you have coded disable navmeshagent
@CypriCar4 жыл бұрын
i did a project but when i am going to red gizmos unity give me this error : " MissingComponentException: There is no 'NavMeshAgent' attached to the "Enemy" game object, but a script is trying to access it. You probably need to add a NavMeshAgent to the game object "Enemy". Or your script needs to check if the component is attached before using it. UnityEngine.AI.NavMeshAgent.SetDestination (UnityEngine.Vector3 target) (at C:/buildslave/unity/build/artifacts/generated/bindings_old/common/AI/NavMeshAgentBindings.gen.cs:35) Enemy.Update () (at Assets/Codes/Enemy.cs:20) " Could you help me guys
@tdawg63484 жыл бұрын
ChlodWin did you try adding a NavMesh?
@MLDEDXX4 жыл бұрын
is there another place I can put the player manager beside the game manager since I only need the ai and not the entire
@ItsCodeRedYT5 жыл бұрын
Thank you so much for this series! I am actually not using this series to make a RPG. Instead, I am using them, to make a MOBA-style game!
@indyt23705 жыл бұрын
Can someone help me? i have the same coding as Brackeys has for the enemy AI but it doesn't work. Like it doesn't give me any errors at all but the enemy doesn't move
@thenumberseven14793 жыл бұрын
You gotta bake it, see the first comment above. Might be a little late though:)
@sgyffysgyffy47367 жыл бұрын
Great work Brackeys!
@Rejnols4 жыл бұрын
Hey there! I'm making AI for a school project. I'm not interested in making the whole RPG, just the AI part. Can anyone tell me why i get an error when i change the public class of the enemy to Interact? I assume it because it was created in a previous episode, but i'm not great with Unity yet so i have no clue how to make that.
@thelegendarymushroom80 Жыл бұрын
:( exactly the same problem here. Did you ever manage to find out about it? I also did not watch previous episodes D:
@thelegendarymushroom80 Жыл бұрын
Decided to speed watch all his episodes until I find the reason, then the second episode hit me haha. It's all in Episode 2.
@Madmanmpu7 жыл бұрын
For some reason, the enemy is not following or moving when the player comes within the distance. Any ideas?
@Madmanmpu7 жыл бұрын
Apparently my Enemy object keeps sinking into the ground on start... Seems to be preventing it's movement.
@Madmanmpu7 жыл бұрын
Ok, apparently I had a few errors. My transform for my graphics was offset, and my capsule collider was to tall/wide. Seems to be operating just fine now.
@Sicho847 жыл бұрын
I love this series. I don't know how far you want to take it, but topics I would love to see covered are amongst others: - changing scene without losing the inventory and stats etc. - saving and loading the game (maybe even with savepoints like in some JRPGs like Final Fantasy) - trading with NPCs or maybe even have dialogue with different options or even different outcomes - a simple system to level up and customizing stats with each level up - day/night cycle or weather effects I know a lot of these things are probably covered in other videos or you could read up on those topics somewhere online etc. but it would be fun to learn these things in the context of this little RPG series :) Of course this list could be endlessly long haha there's so much you could do! Anyways, keep up the good work :)
@bearfeeplayz21684 жыл бұрын
The name 'agent' does not exist in the current context 3:23 helppp meee
@pinklasagnamemes4 жыл бұрын
on your enemy, do you have Nav Mesh Agent Component? If you don't, you need to press Add Component, and in search bar type: "Agent" or "Nav", i think i explained it.
@bearfeeplayz21684 жыл бұрын
Thanks for the help but I just didn't type public NavMeshAgent agent;
@Glubblub4 жыл бұрын
something to note is that if its not working, try going into the PlayerManager script and change (GameObject player) into (Transform player).
@shehzaanansari82047 жыл бұрын
This is amazing bro!
@thomasgamerofhazel22963 жыл бұрын
u was the best person and u will be on our hurts.
@ferrellfamily63163 жыл бұрын
Assets\Scripts\Controllers\EnemyController.cs(23,41): error CS1061: 'Transform' does not contain a definition for 'Postion' and no accessible extension method 'Postion' accepting a first argument of type 'Transform' could be found (are you missing a using directive or an assembly reference?) Help ;-;
@ferrellfamily63163 жыл бұрын
OOOH I JUST REALIZED I MISSPELLED POSITION THATS WHY IT WASN'T WORKING!
@TheJosueWay3 жыл бұрын
If anyone has a set destination error, follow these steps 1. Select your ground and check static on the top right corner of the inspector. 2. Keep your ground selected, and go to the Navigation tab. (Window>AI>Navigation) Then you should see a tab in Navigation called bake. Select it, and click bake on the bottom. 3. Play test your game. It might work it might not. If it doesn't work, follow the next steps. If it does, you are good to go. 4. Move your enemy ai closer to the ground. 5. Play test your game again. It might work it might not. If it doesn't work, follow the next steps. If it does, you are good to go. 6. If your enemy gets stuck in the ground, select your enemy, and in the NavMeshAgent, play around with the base offset. You should see a cylinder. Make that cylinder touch the ground.
@SquidSilver2 жыл бұрын
Thank you so much, you helped me realize I did that too!
@liamsykes4894 жыл бұрын
dose this tutorial work for other games and not just the one hes making
@braaad26134 жыл бұрын
im making an fps and i can confirm that it works for my ai enemies most of these tutorials can be implemented into and type of game
@liamsykes4894 жыл бұрын
thank you so much this is really helpfull
@ChristianRuppelt7 жыл бұрын
Awesome video as always. Would loooove to see this be converted to a multiplayer / coop.
@Nox__4 жыл бұрын
Before brackeys tutorial was a little bit boring like the intro was just "today we are going to make the A.I." Bur now we have a mlittle joke in almost every intro Brackeys really changed in a good way
@mags12055 жыл бұрын
Because of you I create my first "game". Thanks you. Because of it i want to learn English.
@friesandcats19193 жыл бұрын
hows english coming along?
@joshuaalvinreturban25546 жыл бұрын
I followed your first code but no wiresphere seen. How to fix this?
@gagemurphy7774 жыл бұрын
Make sure you have gizmos applied in scene window
@tonysopranodrivingsongslover6 жыл бұрын
even though I copy everything you do it still doesnt work, "SetDestination" can only be called on an active agent that has been placed on a NavMesh, please someone help me.
@alextronic45035 жыл бұрын
you will need to bake nav mesh on the ground they are standing on, its been over an year lol ik, i hope you found it
@Psychopsam2 жыл бұрын
When did the altar object get added? At the start of this video the altar area / ritual area with torches has a platform on it now? Did I miss something?
@shuxinio4 жыл бұрын
Assets\Scripts\EnemyController.cs(6,14): error CS0101: The namespace '' already contains a definition for 'EnemyController' How to fix that? PLS help
@emile143 жыл бұрын
you probably have two of the same scripts
@petre10987 жыл бұрын
Hy, quick question : if there is a wall between the enemy ai and the player, does the ai know to go around the wall or just walks to the wall? Or it has someting like, line of sight when detecting?
@jvcmarc7 жыл бұрын
for the code that Brackeys showed, the enemy would go around the wall, due to the NavMeshAgent Component (it's a unity comnent that helps when creating Ai), but the wall wouldn't block the line of sight of the enemy, you would have to do some more coding for that as well
@petre10987 жыл бұрын
João Vítor Costa Thanks
@ideallyyours7 жыл бұрын
"Line of sight" can be done using raytracing, although excessive use of this could slow down performance in your game.
@Zukomazi5 жыл бұрын
I followed this tutorial to the T, same scripts exactly but the cube would not move. I took off the rigid body, and it works perfect now. Anyone with same problem , try messing with the rigid body
@markfourth5317 жыл бұрын
You're really cool! I love your work. keep up :)
@KEM4OFFICIAL6 жыл бұрын
Hello. Is it somehow possible to handle rotation on raycast hit as you did for FaceTarget() method? Its buggy and not working as same as clicking on object once facing the target (handling rotation without navmesh agent)
@angusmccall34006 жыл бұрын
Don't forget to generate a NavMesh!!!
@VoltFall4 жыл бұрын
How you do that?
@MiniKeanuReeves3 жыл бұрын
For some reason the red circle attack radius never goes away in the scene, is there any way I can get rid of this? It gets really annoying when I'm tryna make other things.
@friesandcats19193 жыл бұрын
honestly, just get rid of it from the script then. its not actaully needed, its jsut to help the game devs visuallize how far the enemy attack range is. players arent going to see the wires so why keep them if you dont want them?
@baherarts3 жыл бұрын
@@friesandcats1919 If anyone has a set destination error, follow these steps 1. Select your ground and check static on the top right corner of the inspector. 2. Keep your ground selected, and go to the Navigation tab. (Window>AI>Navigation) Then you should see a tab in Navigation called bake. Select it, and click bake on the bottom. 3. Play test your game. It might work it might not. If it doesn't work, follow the next steps. If it does, you are good to go. 4. Move your enemy ai closer to the ground. 5. Play test your game again. It might work it might not. If it doesn't work, follow the next steps. If it does, you are good to go. 6. If your enemy gets stuck in the ground, select your enemy, and in the NavMeshAgent, play around with the base offset. You should see a cylinder. Make that cylinder touch the ground.
@vbwebb7 жыл бұрын
Hey!! I'm making this game and want switch camera! Do you have any video were you show how to do that? Great videos, keep it up!!
@MattRynbrand7 жыл бұрын
Just have a reference to both cameras, and simply enable & disable them as needed.
@Mr.Adhesive7 жыл бұрын
dextrex Victor you could also just store two positions, and always have the camera at one position. This would probably prevent small lag spikes on the other guys method.
@leptosurreal4607 жыл бұрын
Store 2 empty gameObject and use transform.Translate. You can also use camera.LookAt with the right range.
@anandkrishna5906 жыл бұрын
Use Vector3.lerp() instead of transform.Translate().
@leptosurreal4606 жыл бұрын
Yes! That's a good idea ^^.
@redarktech4 жыл бұрын
Thanks Brackeys, your tutorial is really helpful, understand, and...free. I wish that you can make more tutorial and yeah.I like your tutorial **Hope you can get some money from your videos**. Lol
@OLUVUH7 ай бұрын
MY ENEMY GOES THROUGH WAAAAALLLLLLLLLLLLLLLLLLLS
@itsinugami3 жыл бұрын
Been watching these videos cause I, when I get a new computer, want to make a first person Dungeon Crawler, similar to Fromsoftware's King's Field games.
@jaridkeen1235 жыл бұрын
6:34
@canadianrocketman34754 жыл бұрын
tyty
@fv4202x4 жыл бұрын
oldcommentyoutuber
@IFCreativeAlt3 жыл бұрын
???
@min02-2135 жыл бұрын
hey how did the GameManager appear?? need help
@samzou62555 жыл бұрын
he made a "create empty" and named it "GameMaster" and put the scripts :)
@Krexalll7 жыл бұрын
This is great! I really love your videos!
@lablabs37265 жыл бұрын
Brackeys you dont have Crafting system video right? i was trying to ... but hard to apply to my inventory its kinda confusing
@ghostdeveloper18334 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object EnemyController.Update () (at Assets/Scripts/Controllers/EnemyController.cs:23) anyone know how to fix this one?
@treidex4 жыл бұрын
Same
@tombecker11974 жыл бұрын
using System.Collections; using System.Collections.Generic; using UnityEngine; public class enemy : Intractable { public override void Intract() { base.Intract(); // Attack the enemy } } what am i doing wrong
@ThiagoSoli3 жыл бұрын
Intractable ?
@owenconnolly86272 жыл бұрын
I have the same problem
@TotatoC5 жыл бұрын
"We would love to teach you to code a really fun way"
@dascience11472 жыл бұрын
u know what bros? I'm SUSCRIBING TO BRACKEYS LEZ GOOOOO! WOOO HOOOO! YAAAAAAAAA...
@lazyrafay2 жыл бұрын
sadly hes not going to make vdos anymore
@favour54424 жыл бұрын
This is the only video that I've watched that you rushed without explaining much
@juliancanery34244 жыл бұрын
I'm stuck on Gizmos... when I type it in the editor it doesnt turn orange like in ur tutorial. it just shows up as regular text.
@farhanhakim21894 жыл бұрын
Maybe it doesn't show because you aren't using UnityEditor
@simas80392 жыл бұрын
depending on the program it doesn't show as orange text, for example mine is in regular text but works just fine
@ondrejkarbas72877 жыл бұрын
Will you also do saving? That's the only part i don't know how to do
@Ownage4lif317 жыл бұрын
Ondřej Karbaš usually you store it in xml and load the data. You see that most games have their own file, id be interested too to see how he does it with unity.
@ondrejkarbas72877 жыл бұрын
RandomSilly i know how to do it in simple games (mobile games for example) where you just need to save money, finished levels and stuff like that, but in a gamd where you can save whenever you want it will be much harder
@ondraenglish81317 жыл бұрын
Ondřej Karbaš make game objects from the XML?
@ondrejkarbas72877 жыл бұрын
Ondra English i didn't know if there was a more optimised way
@gastonmolina77847 жыл бұрын
You can make a binary .dat file storing your data with a System namespace. Unity has a tutorial for this. Google it, persistance and duration Unity tutorials I guess you will find it that way.
@ImusingX5 жыл бұрын
i am using your script and i get the following error: Assets/EnemyController.cs(15,2): error CS0246: The type or namespace name `CharacterCombat' could not be found. Are you missing an assembly reference? Can someone help me?
@rodrigo.cs.machado5 жыл бұрын
You and Sebastian help a lot. Thanks for the videos and tutorials. I do not know if they stopped creating videos, and if you still have a chance to collaborate on patreon.
@francek38922 жыл бұрын
Sebastians AI for the animations kinda suck bcs he didn't showed how he puted the animations to the enemy I tried it several times and it doesn't work. Like the enemy is attacking but am getting errors for the attack animation
@bakatoxo87557 жыл бұрын
Hi there, I've got a doubt: why use that method to keep facing the player instead of using LookAt()?
@RitobanRoyChowdhury7 жыл бұрын
The look at methods just act really weird. I've very rarely been able to make them work the way I want them to. I suspect the problem here is that he doesn't want the enemy to rotate on the x or z axes. Look At doesn't allow that. Its easier to just write some extra code to calculate this by hand than trying to fiddle with the input parameters to get the right results.
@bakatoxo87557 жыл бұрын
I use LookAt(new Vector3(player.transform.position.x, this.transform.position.y, player.transform.position.z)) to avoid rotating in the Y axis. Although I should probably use his method to have more control over what the enemy does.
@RandyS12147 жыл бұрын
Hey Brackey , for some reason my enemy AI chases me but dosen't stop in front of my player character, instead it pushes it around because its trying to go to the exact transform location of my player. Where could be the problem?
@rahulgarg90807 жыл бұрын
RanTheMan100 ur stopping distance could be set to 0
@RandyS12147 жыл бұрын
thats what it was i figured it out a few days after my comment, must of missed that part in the video
@radradradrad51136 жыл бұрын
My enemy stops following the player after some time. and also on that line "using UnityEngine.AI;" i'm geting an error so, when i want the script to work i have to disable that line. I'm using Unity 5.0.1f1. is it because my unity version is older?
@Paul-rd5zk5 жыл бұрын
Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'Interactable' could not be found (are you missing a using directive or an assembly reference?) Assembly-CSharp C:\Users\Jack l\Unity\Game\Assets\000Scripts\Zombie Scripts\Enemy.cs 7 Active
@jacobWhite5174 жыл бұрын
Paul that most likely means you made referenced a variable/object in the code that doesnt exist, so you either spelled something wrong, or just completely messed up somethings name
@amsyarsyahrizal64234 жыл бұрын
Sorry I'm a bit late, but to anyone else who has this problem: Make sure to watch this video first -kzbin.info/www/bejne/b6XIga2vgZuXncU
@cheeseydirt844 жыл бұрын
i follow the instructions and it came up with this. "SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination(Vector3) EnemyAI:Update() (at Assets/EnemyAI.cs:28) ? what does it mean
@WGUG45 жыл бұрын
can someone please help me For some reason my gizmo isn't apearing and I don't Know if i am doing something wrong or it just don't work anymore if someone can test and tell me if my version of unity is still working I would be grateful I am using unity 2018.3.14f1
@rerwerwqdsdfsdafdsf50065 жыл бұрын
private void OnDrawGizmosSelected() { Gizmos.color = Color.red; Gizmos.DrawWireSphere(transform.position, LookRadius); } And dont put it in Void update