Removed in version 2019.1.14

GameObject.audio

Switch to Manual
Obsolete public Component audio;

Description

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

using UnityEngine;

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

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