Chapter 8. Positions, Movement and Navigation for Character GameObjects

In this chapter, we will cover:

  • Player control of a 2D GameObject (and limiting the movement within a rectangle)
  • Player control of a 3D GameObject (and limiting the movement within a rectangle)
  • Choosing destinations – find the nearest (or a random) spawn point
  • Choosing destinations – respawn to the most recently passed checkpoint
  • NPC NavMeshAgent to seek or flee destination while avoiding obstacles
  • NPC NavMeshAgent to follow waypoints in sequence
  • Controlling the object group movement through flocking

Introduction

Many GameObjects in games move! Movement can be controlled by the player, by the (simulated) laws of physics in the environment, or by the Non-Player Character (NPC) logic; ...

Get Unity 5.x Cookbook 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.