How to create a Button with Modifiers in Unity UI (ctrl, alt, shift, shoulder button, ...)

Published: 07 April 2025
on channel: Christina Creates Games
502
46

This tutorial teaches you how to create a button that uses modifiers to change its behaviour. This will use the new input system. A typical use case would be an inventory or resource management system, where one click takes an item, using the shift modifier with a click takes multiple, alt modifier with a click chops the stacks in two and so on.

This system will handle:
OnClick events for no modifier, one modifier, another modifier or both at the same time
Notifier events to subscribe to, depending on which combination of modifiers you hold down

Hope you enjoy it!

📖 Chapters
00:00 Use case for a modifier button
01:00 Setup in the Unity Editor
01:58 The script handling modifier input for the UI Button
07:11 Implementing the scripts in the Editor
08:08 Setting up the new input system
09:54 Adding the button to the right click menu

✒️ Github: https://github.com/Maraakis/Christina...

💬 Join the Discord
You are very welcome to join   / discord   !

🎮 Play My Games
🎲 https://christinacreatesgames.itch.io

🛍️ Recommended Assets
These are my go-to assets I install in almost all projects by default:
🧰 Highly Recommended Assets: https://assetstore.unity.com/lists/hi... [affiliate]

Otherwise, using my affiliate codes for these stores helps to support my channel:
🛒 Unity Asset Store: https://assetstore.unity.com/?aid=110... [affiliate]
🏪 Synty Store: https://syntystore.com/christinacreat... [affiliate]
🪸 Envato Elements: https://1.envato.market/ChristinaCrea... [affiliate]

🌟 UI Feedback for Your Game
I offer UI consulting for gamedev projects! With 15+ years of design experience and a background of a teacher, I’m here to help:
👉 Learn more: https://www.vennegerts.com/en/gamedev...

☕ Support Me on Ko-fi
If you enjoy the content and want to support my work:
💛 Buy me a cocoa: https://ko-fi.com/christinacreatesgames

#unitytutorial #unity3d #gamedev #indiedev


Watch video How to create a Button with Modifiers in Unity UI (ctrl, alt, shift, shoulder button, ...) online, duration hours minute second in high quality that is uploaded to the channel Christina Creates Games 07 April 2025. 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 502 times and liked it 46 visitors.