Visual Scripting with a UI Button - help or advice request -

Visual Scripting with a UI Button - help or advice request -
Hi I’ve just started learning Unity and have been pleased to find that there is a “Introduction to Visual Scripting” tutorial - that’s great as I’m not a coder (yet…) but I’m having problems finding online advice and more visual scripting tutorials -as I think its so new to v2021.1. (I know it was previously called bolt but that stuff seems to have slightly different implementation) so am focussing on the current release.

I’m Interested in controlling UI buttons via visual scripting.
I have a primitive that can spin - I just want to start and stop it spinning with the UI button,
I’m guessing that I need to look at a “Button.onClick” event unit, but i cant work out what to do to link up the UI Button. any tips, or examples that anyone can share please>?


P.S. if there is a more appropriate location to post this please let me know
thanks

This should work. When you create your button UI, drag and drop it into the “On Button Click” node. Make sure the object you want to rotate is in the “Transform Rotate” node as well.

Thanks for the input Renicon13377 - no luck after looking at your illustration.

Regarding your comment If you don’t mind clarifying, I only seem able to drag a button that has been made into a prefab onto the “on button click” event node - (as i’m so unfamiliar) - is that expected>?

I’m wondering if i need to implement any special config in order to get the button to see or talk to the Visual script.

I’ve seen the info here : is this optional or a requirement for interacting with a UI button via VS (cant tell if this is relevant of not)
“Capturing player inputs using the input system”
https://docs.unity3d.com/Packages/com.unity.visualscripting@1.7/manual/vs-capturing-player-inputs-new.html

Next query - see below:

7475798--919097--upload_2021-9-6_14-38-13.png

Assuming the button interaction is being setup in a visual script graph - is this “on Click ()” field in the button inspector also need to be populated>? could it be conflicting>? if it is needed, how should it be configured?

Thanks in advance

When you add the “On Button Click” event node in your graph, you don’t need to put anything in the “On Click ()” section of the button component. As long as your script machine or state machine is on the same Game Object that containing the button component, you are ready to consume the click event.

thanks for clarifying ericb_unity.1587671

I Still can’t get a button to show anything using a VS graph as I don’t know how to set it up. Can you think of any specific examples, tutorials to recommend or give some detailed screenshots on the basics please
thanks in advance

This is how you should make the setup.

7483670--920534--upload_2021-9-9_9-57-45.png

how do i make it when you hold click on a button it will keep holding and not only click once? thank you in advance

I would suggest creating a new thread with this subject.

Does not even work