Join Alan Thorn for an in-depth discussion in this video Completing the idle state, part of Cert Prep: Unity Particle Systems, AI, and Audio.
- [Instructor] In this movie, we're going to continue on…looking at the idle state for the NPC character.…In the preceding movie we saw that we can generate…a random point on the navigation mesh.…This is the point that we should move to…while in the idle state.…I'm going to scroll back up in the code,…back to the original idle state,…which is around about here,…and take a look at the next steps.…So after selecting a random point on the navigation mesh,…we simply loop around continually in the idle state here.…
For as long as the state is idle,…we continually loop through this,…and we're using the yield return null statement…to take temporary pauses on a frame by frame basis…to make sure that the infinite loop…doesn't lock the computer.…So doing that continual loop,…the navmesh agent is continually moving towards the point,…the random point on the navigation mesh here.…After a specified time elapses,…we simply pick a new point on the navigation mesh…and move towards that.…
The only check that we have here…that is in addition to that…
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