While the rest of the recipes in this chapter are demonstrated in 3D projects, basic character movement in 2D and also limiting the movement to a bounding rectangle, are core skills for many 2D games, and so this first recipe illustrates how to achieve these features for a 2D game.
Since in Chapter 3, Inventory UIs, we already created a basic 2D game, we'll adapt this game to restrict the movement to a bounding rectangle:
![](https://static.packt-cdn.com/products/9781788471909/graphics/assets/76b6b50a-1659-4d5c-8de2-db2777b28ce4.png)