To create an analog stick that moves in eight directions, as shown in the previous image, complete the following steps:
- Create a new scene named Chapter10Example3 in the Assets/Scenes folder and open the new scene.
- Create a new image with Create | UI | Image. Name the new image Stick Base.
- Add the d-pad buttons_15 sprite to the Source Image slot of its image component.
- Right-click Stick Base in the hierarchy and select UI | Image to add an image child to the Stick Base. Name the child Stick.
- Resize the Stick image to match the Stick Base by setting its Rect Transform stretch and anchor to stretch fully across both directions.
- Add the d-pad buttons_0 sprite to the Source Image slot of ...