A
A
Alex2019-10-29 20:13:34
User interface
Alex, 2019-10-29 20:13:34

How to check hover on UI element?

There is a UI element of text. I tried using

void OnMouseEnter()
    {
        print(1);
    }

but it doesn't output anything.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-10-30
@MrMureno

Is there an event system in the scene? what kind of custom?
canvas, on which the UI, contains Reycaster ??
also, depending on the type of canvas, you may need to specify a camera that checks / generates events.
in general, as you were already told in the comments - you need much more details))
or look for an example of a project where it works - and compare what you lack.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question