How to update my code, that a click on a UI button ( "button clicked: Button" ) is detected immediately, and not just by the 2nd. click?
I followed a simple training video how to build a UI button.
Sourcecode:
Instructions:
- Please fork this project and load it into your CORE IDE.
- In your CORE IDE, open the "Event log" window.
- Move your cursor on the white star and cklick several times.
Question:
1 Why must I press the button twice on the star, to get the message
"button clicked: Button"
instead of that this message already appears the FIRST time?
- How to fix the code, so that the message appears for the FIRST time I click on the star.
--
Update:
I added UI.SetCanCursorInteractWithUI(true)” at the start of the script, but kept it as comment.
- If “UI.SetCanCursorInteractWithUI(true)” ⇒ “button clicked: Button” immediately detected by the first mouse click.
- If “UI.SetCanCursorInteractWithUI(false)”, the default setting ⇒ “button clicked: Button” is detected by the 2nd. mouseclick.
Any further explaination would be great!
SIncerely
Rolf