R
R
Roman2017-08-14 19:22:03
Unity
Roman, 2017-08-14 19:22:03

Button in Unity 2D?

How to make a button in Unity 2D?
There are sprites, but Google suggests that I create them through

GUI.Button(new Rect(10, 30, 180, 30)

What a wonderful code "If you clicked on a sprite", tell me!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2017-08-14
@ananas_roma

GUI.Button is old and slow, no one uses it, you need Canvas , you can start with the official tutorial . For "if the sprite is clicked" there is a special Button component .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question