Play audio with visual scripting in Unity

Playing an audio clip with visual scripting is as simple as playing audio using code in Unity. You can better control on playing audio with code but if you are going to just click play then visual scripting is the easiest one. In this tutorial, we will play an audio clip after 10 second’s delay.

I am using Unity 2021.1.13 for this tutorial.

Adding components

  1. Create an empty game object and name it audio_object.
  2. Add a Script Machine component and an Audio Source component.
  3. Add your audio clip to the Audio Source component.
  4. Uncheck Play on Awake on the Audio Source.
  5. Click new on the Script Machine to create a new flow graph.
  6. Let’s name it Audio_player.

Creating the flow graph

  1. Click edit graph.
  2. Add an Audio Source:play(delay) object.
  3. Enter 10 in the delay input.
  4. Connect the start event to the Audio Source object.

That’s it you have created a logic to play an audio clip after 10 second’s delay.

play audio flow graph

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.