To use sprite placeholders to create a simple physics scene, follow these steps:
- Create a new Unity 2D project.
- Create a new Sprite Placeholder asset file named Triangle by going to Assets | Create | Sprites | Triangle. You should now see an asset file in the Project window named Triangle.
- Create a folder in the Project window named Sprites and move your Triangle sprite file into it:
Figure 6.51 – The new Triangle Sprite asset file in the Project window
- Drag the Triangle Sprite file into the scene to create a GameObject named Triangle.
- Ensure the Triangle GameObject is selected in the Hierarchy window. Then, in the Inspector window, set the Color property of the Sprite Renderer component to a red-pink color.
- In the Inspector window, add a Polygon Collider 2D component by clicking the Add Component button).
- Then, add a Rigidbody 2D component.
- We don't want our triangles to move at all (they are mountains!), so we will freeze their X...