Creating Fantasy Crystals in Unity

Going over how I made the shaders and scripts for fantasy crystals in Unity

Objective: Explain how I created some floating, fantasy crystals in Unity

The Functionality

To get the effect seen above, I utilized both C# scripts and ShaderGraph. To start things off, the main chunk of code I created to get the crystals to float as shown above is as follows:

I plan to modularize the script above in the future, but I will leave things like this for now. I also created a simple rotation script to handle rotation on any GameObject I attach this script to.

With these scripts, I then went ahead and created the ShaderGraph which gives the crystals the look they have. The ShaderGraph is as follows:

Lastly, I went ahead and created some particle effects and added some lights to fully create the look seen in the results below.


These are just a few examples of what can be done with the shader and scripts I created. That’s all for today! Thank you for reading today’s article. In the next article, I will be starting a new 2D Mobile Game project!




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to build a table with concurrent horizontal and vertical sticky headers in pure CSS

Brush off your coding skills using Codecademy

All the While

Day 66 — Modular Waypoint System in Unity

On Reading Code Well

Serverless Apps to Automate Chores Around Cloudwatch Logs

Why I am a flutter Developer?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gabe Gomez

Gabe Gomez

More from Medium

What are Unity Skyboxes?

Adding enemies to our greybox Prototype

Pushing a box

Creating a Sci-fi Lab Room