Adding NPCs and a conversation system to our game

Right, after all of that brain input, let's start applying it to our game. In this chapter, we are aiming to add an NPC to our scene that will interact with the player.

Before moving forward, we should also do with a little tidying up of our Scripts folder, since we are generating a lot more content now. To do this, perform the following steps:

  • Under Assets\Scripts, create three new folders: Classes, Messaging, and Navigation.
  • Copy the Entity and Player scripts to the new Classes folder or create them if you haven't already.
  • You may delete all of the files created in this chapter (or place them in an Examples folder) except MessagingManager.cs, MessagingClientBroadcast.cs, and MessagingClientReceiver.cs ...

Get Mastering Unity 2D Game Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.