The Unity Button Tutorial | How to setup, add OnClick method by script and more

preview_player
Показать описание
This tutorial teaches you: how to set up a button in Unity from scratch, assign functionality for On Click per script or the inspector, understand how to setup different transition modes for using Sprites and more and find out how to solve the issue of players not being able to click on buttons!

💬 Discord 💛

🛍️ Affiliate links 🛍️
If you'd like to support my channel, please use my affiliate links when buying cool stuff:

🌟 Need help with your project's UI?🧠
I have been a designer for more than 15 years, a teacher for three and I offer paid consulting for your project! You can find all the information here:
I am looking forward to hearing from you 💛

📖 Chapters
00:00 What we will tackle in the Button tutorial
00:38 How to create a button in the inspector
02:41 The button component
03:14 Button Transition: Color mode
04:53 Button Transition: Sprite mode
05:42 Button Transition: Animation mode
06:12 Navigation
06:37 How to setup a method for button click
07:55 How to setup a method for button click by script
09:33 How to change transition settings through script
10:50 What to do when button does not react
11:47 Optional: The Event Trigger component

Рекомендации по теме
Комментарии
Автор

Thanks for this! You were the top search for "how to configure button on click script unity"

jaqkk
Автор

Thank you so much for the indepth tutorials, this shere with UI has been lacking for some time!

CyberStudios
Автор

I was looking every where to learn how to do this.

derpycheepcheep
Автор

I love your lessons. They are very simple, but rich in information.

Shineglow
Автор

Thanks for the video!
I still haven't opened Unity, but if I ever overcome my fear of the program, I at least know how to make a button! :D

Goldy
Автор

Yet another feature I had no idea existed!
Very cool!

alexleonardkrea
Автор

today i just got a problem with 2 buttons that share the same script but with 2 different methods on the On Click() event, somehow they refuse to work together, and i ended up removing one of the 2, calling the other method in another way.... i really hope that does not happens everytime i need 2 buttons sharing the same script.

BlacklusterPally
Автор

The hierarchy isn't creating a button :(
I can't find the option

DaPointa
Автор

I dont know if anyone will respond to this but, the "Button" I have set up isnt appearing in my game window only in my scene. Does anyone know a fix?

Feelin_Funny
Автор

women coding is pretty cool :0 so i liked and subscribed
nice work you do👏🏼👏🏼

temp-not.of.thatkind