Join Alan Thorn for an in-depth discussion in this video Starting the idle state, part of Cert Prep: Unity Particle Systems, AI, and Audio.
- [Instructor] In this movie, we're going to start…opening up the artificial intelligence…for the NPC character…to see how it works,…and this is a really useful exercise,…because when you understand…how the finite state machine works…for this particular NPC character,…then you'll be much more able to create…an AI for your own characters.…So, I'm going to move down here to the project panel,…and double-click on the AI agent script…to open that inside MonoDevelop here.…And here is the script file that we've created here.…
Notice were using the UnityEngine.AI namespace,…which incorporates all of the navigation mesh features.…Now, what I've gone ahead and done is…I've created a new enumeration on this line here,…which incorporates the idle, chase, and attack state…for the NPC character.…So, this doesn't actually tell us…which state the NPC is in,…it simply tells us the total range of states…that it could possibly be in.…The next statement, the AISTATE variable,…which is the current state,…that identifies the active state for the NPC character.…
This course is part of our Unity cert prep series, focusing on exam objectives related to particle systems, artificial intelligence (AI), navigation and pathfinding systems, and audio. Instructor Alan Thorn teaches you how to control particle emitters, including particle life and size. He explains how to use navigation meshes to control obstacle avoidance, create compelling NPCs by setting up and triggering animation states, and add music and sounds effects to your 2D and 3D games.
Find out more about Unity Certified Developer exam at https://certification.unity.com/.
- Shaping and controlling particle emitters
- Adjusting particle life and size
- Moving objects
- Working with navigation meshes
- Starting and completing idle states
- Starting chase and attack states
- Adding music and 2D and 3D sound