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.

Results

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

The Philosophy Behind The Best AMM DEX on the Market

Write a program in your preferred language that prints its source without receiving input

Write a program in your preferred language that prints its source without receiving input

Day 5: 100 Days of Code — 7–9–2019

Svn to Git migration an easy guide

Update salesforce objects and listen to the salesforce objects via WSO2 Micro Integrator

Terraform data source tricks

Least Privilege Access with Role Base Access Control (RBAC) in a particular Namespace with…

A modern ETL pattern using Prefect’s S3 Storage and Kubernetes runtime

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

Cinematography In Unity — Cameras In Cinemachine

Platformer: Elevator

Unity Interface Layout

Script Communication in Unity Using GetComponent<>