How to import free graphic assets into Unity?
Creating a video game project requires various visual elements to achieve a compelling and engaging product. Finding and using free graphical assets can be a great way to get started. In this content, we will explore how you can incorporate these elements into your own project using Unity, starting by examining what graphic assets are and how to use them legally and efficiently.
What is a graphical asset and how to get one?
Graphic assets are visual elements that are used in video game development to enrich the user experience. These can be images, textures, sprites, sounds, 3D models, among others. An excellent resource for acquiring quality assets are those under the Creative Commons license. This license allows the use, modification and redistribution of the assets, even for commercial purposes.
Example of a free asset resource
One of the most recognized creators of free assets is Kenney, who has published hundreds of elements ready to be used by developers all over the world. However, he is not the only option; there are numerous websites where you can download these assets, and in the class resource file, some examples of platforms are included.
How to import assets into Unity?
Once you have your graphic assets, the next step is to import them into your Unity project. Here we take you step by step through the process:
- Create a folder in the assets section of your project: Right click, select "Create", then "New folder" and name it 'sprites'.
- Import the assets: Inside the created folder, right click and choose "Import new assets". Navigate to where your sprites are stored and select the ones you want to import.
- Adjust the units per pixel settings: They are initially set to 100 units per pixel. Experiment with this value to adjust the size of your sprites to suit the needs of your game. For example, changing to 300 units per pixel can make the sprites take up a single unit of in-game space, ideal for certain designs like the one we used in the Max3 project.
spriteRenderer.sprite.pixelsPerUnit = 300;
Why use version control with GitHub?
Version control is vital in any development project. GitHub allows you to keep track of every change you make, ensuring that you can roll back to previous versions if necessary, and makes it easy to share your progress with other developers.
- Upload your changes to GitHub: After you've added assets and made configurations to your project, review the changes in the corresponding tab on GitHub Desktop.
- Make a commit: Give a meaningful description to your commit, for example, "We added the initial assets", to make it easier to identify the change in the future.
- Keep a commit history: With the commit history you can see the progress made during the project, increasing the security of your data and collaboration with other developers.
Best practices when managing assets
- Organize your files from the beginning: Maintaining an orderly structure will make it easier to manage and access your assets.
- Use version control consistently: Making commits every time you complete a significant task in your project will help keep everything under control.
- Share your asset sources with the community: If you know of other places to get assets for free, share them to support other developers.
Correctly incorporating assets to your project is a fundamental step to start the development of a video game. Explore the resources, adjust the right settings and make sure to use a version control system to keep your progress safe. Cheer up, you are on the right track to develop an exceptional game!
Want to see more contributions, questions and answers from the community?