Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

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

Removed in version 5.0.1p4
Property audio has been deprecated. Use GetComponent<AudioSource>() instead. (UnityUpgradable)

GameObject.audio

Switch to Manual
public var audio: Component;

Description

The AudioSource attached to this GameObject (Read Only). (null if there is none attached).

	var other : GameObject; 
	other.GetComponent.<AudioSource>().Play();