# Setup Candy Machine

Solana Godot SDK features implementation of [Metaplex Core Candymachine](https://developers.metaplex.com/core-candy-machine), which allows minting generated Assets from a premade collection, with Candy Guard support!

This is one of the most powerful features in the SDK, allowing developers to setup a much more interactive and interesting Asset minting experience using Godot game engine.&#x20;

## Step 0: Setup Asset Collection

Before implementing your NFT collection's minting inside Godot, you need to [set it up first](https://developers.metaplex.com/core-candy-machine/create). Once you have created a new Candy Machine and the necessary candy guards, you can bring it to Godot for minting.

## Step 1: Mint Settings

We have prepared a very convenient class for setting candy guards in Godot, which you can create by right-clicking in the project's FileSystem, and choosing _Create New -> Resource_. Then, search for **CandyGuardData.**

If you have set your Candy Guards when initializing the collection, this class will be very familiar: you have all the different guards on a _Default_ guard group, and for any additional groups, you can just tick "Enable Groups" and create new **CandyGuardData** in the _Groups_ section!

<figure><img src="https://3564869985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbBsXAvrfZka40bbQ0val%2Fuploads%2FYJfpbWXfBHf5gvFDsn5D%2Fimage_2025-03-06_161122985.png?alt=media&#x26;token=aef291f6-866d-4c0b-9830-00df6b5b9018" alt=""><figcaption></figcaption></figure>

What you need to do is copy the guards here exactly how you did when creating the candy machine and save this file. You will need it to pass in later.

## Step 2. (Optional) Add Default Plugins

With CORE Candy Machine, you can optionally pass in Plugins file, which will add all those plugins on the newly-minted Asset. This is great for adding royalties, verified creators and other plugins that may suit your project.

The easiest way to set Plugins is to create a **MintAssetArgs** resource and manually setup all the desired plugins, which will be passed into minting script.

You can also create the resource in-script, which can be useful if you want the minted assets to have different attributes, which get determined in the game project

<figure><img src="https://3564869985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbBsXAvrfZka40bbQ0val%2Fuploads%2Fe2LkJ4qDu6f1q6dhyRGS%2Fimage.png?alt=media&#x26;token=caf8a26a-4670-4f2a-acc7-8fd60ea71a21" alt=""><figcaption></figcaption></figure>

## Step 3. Mint The NFT

For your convenience, we have a script called **CoreMintManager** which makes setting up your candy machine trivial if you have all the required resources. check _SolanaSDK -> Demos -> CandyMachineDemo_ in the imported SolanaSDK addon!

<figure><img src="https://3564869985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbBsXAvrfZka40bbQ0val%2Fuploads%2Fmjl4HLhZpFZ5AfwPU8rq%2Fimage.png?alt=media&#x26;token=c352ae39-607f-4d3e-86bd-f2eaab9fbac0" alt=""><figcaption></figcaption></figure>
