Why HitBoxBeginCursorOver worked only when pressed button on mouse?

Here is my script to draw two pictures, depending on hovered HitBox by mouse or not.
And it’s work only when i hold on mouse button.What should i do,to make this work only on hovering?Without pressing button?

Anyone? Is it bug?

Have you tried naming your hit box and only changing your variable if the box with that name gets cursor over? Perhaps there are other hit boxes that also fire the event.

Hmm.I will try
I have only one HitBox.And as i see there is a problem with order of created object.If i place hitbox in other place it works(but strange,if mouse over it create one thick and after that not working,so why i need to use variable)
So problem with hitbox order.

And could you explain me,how i can bind 2 events(BeginCursorOver and EndCursorOver) to one HitBox? I can bind Box Name from one event to HitBox, and second event just replace…
And is there any event,like this,but that working while mouse over object?
Becouse i just need to replace picture on hud,where mouse is over it.Or my way with setting variable is only one right way?

You may just want to use a widget instead. Then you can just bind the OnHover and OnUnhover events on the widget.

thks,i will try.

Done with more easier way, widget button