GetEvent(T) doesn’t work OnClick()

Forums đź’¬ FlowCanvas ⚙️ Support GetEvent(T) doesn’t work OnClick()

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #12026
    dryrel
    Participant

      Hi!

      I created a flow script for the options.

      [attachment file=”image_2023-02-03_011830945.png”]

      And I’m trying to set this value via Button.

      [attachment file=”image_2023-02-03_011925645.png”]

      However, GetEvent(T) doesn’t work. GetEvent works but in this way, I cannot change the value of the options.

      What should I do?

      Thanks in advance

      #12031
      dryrel
      Participant

        Please check the attachments

        #12030
        Gavalakis
        Keymaster

          Hello again,

          The Unity events in the inspector like the button Click events only work with only one parameter and this parameter is reserved for the string name of the event of the flowscript, thus, unfortunately, calling T events is not possible with Unity events directly.

          Having said that, I could try to make it possible to pass parameters in parenthesis like you tried to do in the screenshot for the sake of making it able to call events with parameters this way.

          Let me know.

          Thank you.

          #12029
          dryrel
          Participant

            [quote quote=3431]Hello again, The Unity events in the inspector like the button Click events only work with only one parameter and this parameter is reserved for the string name of the event of the flowscript, thus, unfortunately, calling T events is not possible with Unity events directly. Having said that, I could try to make it possible to pass parameters in parenthesis like you tried to do in the screenshot for the sake of making it able to call events with parameters this way. Let me know. Thank you. [/quote]

            Hello!

            It would be great if you could do this.

            But right now, how do you think I should solve what I want to do? I want to change those parameters via button.

            Button (Prefab):

            OptionTitle [<] OptionValue [>]

            Each time the next [>] or [<] back button is pressed, the number of indexes changes and the text is set in the array.

            However, it currently has no function. Since GetEvent(T) is not passed with OnClick(), how should I proceed?

            #12028
            dryrel
            Participant

              Hey! Can you give me an advice? What should I do?

              #12027
              Gavalakis
              Keymaster

                Hello and sorry for the late reply.

                I suggest that you simply:

                1. Drag and Drop the Button object into the flowscript canvas.
                2. From the menu select “Button/Event/onClick (Auto Subscribe).
                3. Then use the node that will be created to call nodes or send events as normal in flowcanvas, like in your example use the SendEvent(bool” node (or simply directly do what you have to using the OnClick event node output) 🙂

                Let me know if this works for you.

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.