Style your Unity toggle switch with color and material transitions!

Published: 19 December 2023
on channel: Christina Creates Games
1,537
86

Style your toggle switch with color and material transitions! We created the switch system for Unity in a previous tutorial.


Sometimes, the material transitioning versions might show red pixels at the outline. It happened on some iterations for me. Setting your Canvas to Screen Space - Camera gets rid of them. Unity 6 will implement UI shaders, I hope this won't be an issue anymore then.

✍️ Script on Github
https://github.com/Maraakis/Christina...

🎆 Images on Discord!

💬 Discord 💛
You are very welcome to join!
  / discord  

🛍️ Store links 🛍️
If you'd like to support my channel, consider using my affiliate link when buying cool stuff in the Unity asset store: https://assetstore.unity.com/?aid=110... [Affilate link]
Or on Humblebundle: https://www.humblebundle.com/?partner... [Affiliate link]
Or in the Synty Store: https://syntystore.com/98327 [Affiliate]

🎮 Play my games on Itch.io 🎮
https://christinacreatesgames.itch.io

📖 Chapters 🔖

00:00 The end result
00:13 Updating ToggleSwitch.cs for inheriting
01:19 Style 1: Color Transition
03:25 Style 2: Material Transitions (Preparations)
03:45 Creating the Shader
06:13 Material Transition (Script)
07:28 End result & final remarks


Watch video Style your Unity toggle switch with color and material transitions! online, duration hours minute second in high quality that is uploaded to the channel Christina Creates Games 19 December 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,537 times and liked it 86 visitors.