Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AudioSource.loop

Switch to Manual
public var loop: bool;

Description

Is the audio clip looping?

If you disable looping on a playing AudioSource the sound will stop after the end of the current loop.

	@script RequireComponent(AudioSource)
	// Stop looping the sound
	function Start()
	{
		audio.loop = false;
	}