Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#
Removed in version 2018.2.21

Component.audio

Obsolete public Component audio;

Description

The AudioSource attached to this GameObject. (Null if there is none attached).

using UnityEngine;

public class Example : MonoBehaviour { void Start() { GetComponent<AudioSource>().Play(); } }

Did you find this page useful? Please give it a rating: