Create and Sell Unity Prefabs as Crypto Collectible NFTs Using IPFS

Created with Unity Engine, Pinata and Rarible

Leon Do
Pinata
4 min readAug 11, 2020

--

At then end of this blog, you will have learned how to:

  1. Create a simple Unity prefab
  2. Upload your prefab to IPFS with Pinata
  3. Upload your decentralized prefab on Rarible

Create Unity Prefab

Create a new Unity project. In this example, we’ll create a simple Pinata cube. Select GameObject > 3D Object > Cube to create a cube.

To resize, select the cube and Transform the dimensions.

Under Assets create a directory. In this example, we’ll call it Pinata-Cube. Verify that the cube object is in the directory. This will help organize the project.

To add texture, right click andCreate > Material. In this example, we named it Pinata

The directory should now have two items, a 3D cube object and material called Pinata.

Next, import your image. Drag and drop the image into the Pinata-Cube directory. Your project should look like this.

There are many options, but in this example we’ll shade the Pinata material with the image. To do so, select the material and on the top right select Shader > Legacy Shaders > Diffuse

Select the image.

The final result should look like this

To further organize the project, create a directory called Prefabs and drag the Cube object into the directory.

To create a prefab, right click the object and Export Package...

Name and save the package. In this example, we’ll call it pinata-cube.unitypackage. This will pinned to Pinata.

Upload to IPFS

If you don’t already have a Pinata account, sign up. Once you are logged in, click onPinata Uploadin the upper right of the page.

Next, Browse your computer for the prefab file exported from Unity. Then click Upload.

Next, navigate over to the Pin Explorer. The Pin Explorer is where you can manage all of your IPFS files on Pinata.

In the Pin Explorer, find the prefab file you just uploaded copy the IPFS Hash. The link should look like:

https://gateway.pinata.cloud/ipfs/QmeEzm4yPVSah9uX75VL5ds7htpLN4tf11R6S4SRvqw4NK

Mint NFT

To start minting your prefab, click on the Menu ••• on right side of the page next to your file. Select Mint NFT

You’ll be redirected to Rarible. Follow the prompts to create your collectible.

Choose and image and add a description.

To tie everything together, select Unlock once purchased and paste your IPFS link (from pinata). Finally, click Create. You will now need to follow the wallet prompts provided by Rarible to finish minting the token and signing the transactions.

Your Unity prefab is now minted and ready to be sold across a variety of marketplaces. Happy Pinning!

--

--