Help me with the basics

Forums 💬 FlowCanvas ⚙️ Support Help me with the basics

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #22682
    lundon
    Participant

      I’m trying to get the raw basics here. Say I want to play a sound when I hit the key Z. What Flow controller or Function do I pick for Down? (This seems so very basic that I hesitated even posting it.)

      #22688
      Gavalakis
      Keymaster

        Hello,

        For the most part FlowCanvas uses the Unity native methods to do what you want. So for example here, you could simply use the AudioSource.PlayClipAtPoint function to play an audio clip at a position. You can of course search for it in the browser which you can open up by hitting “Space” in the canvas.
        [attachment file=”PlayClipAtPoint.png”]

        FlowControllers are only used when you want to change the flow based on some factors (like condition check, or splitting), while Functions are what you should use to do things like the example above.

        Let me know if this works for you and of course if I can help you in any other way.
        Thanks.

        #22687
        lundon
        Participant

          Great. Thanks.
          Now what if I want to play a legacy animation rather than a sound? (and yes, I have been trying the search for a long time now.)

          #22686
          Gavalakis
          Keymaster

            Hello,

            You are welcome.
            You can use for example the Animation.CrossFade method for this. In the following example I used CrossFade to play an animation named “Walk” on the Animation component of the gameobject with a crossfade time of 0.2. Of course the gameobject (self) will also need to have the Animation component with an animation clip named “Walk” as well, since that is how Unity works.

            [attachment file=”CrossFadeAnimationLegacy.png”]

            Let me know if this works for you.
            Thanks.

            #22685
            lundon
            Participant

              Nope. Didn’t work for me. I sent you an email via your contact info on this site.

              #22684
              Gavalakis
              Keymaster

                Hey,
                I’ve replied to your email some moments ago.
                Let me know.

                #22683
                kong
                Participant

                  Hello~ do not working…

                  console: The animation state could not be played because it couldn’t be found!

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