Wednesday, March 1, 2017

Day 18: NPCs and Interacting - continued

To continue from last class, I added a script that made the player move to the interactable object when the object is clicked. Now, the original move script allows the player to move, but I need another script to make the player move to the interactable object before the player interacts with it.

I then made an NPC script and added it to my NPC as a component. This is only a base script, but I can build off of it for each NPC.

I needed to do the same thing for the PickupItem as well.

Now when I click the NPC or Pickup, it interacts with it, and moves towards it.

I just need to make the player stop just before the NPC, otherwise it passes through the box. That, however, is what I will work on next class.





No comments:

Post a Comment