AudioSource is Missing

I have a prefab named PrestigeCoin. And it has a script named collectprestige. There is an AudioSource in the script and when prefab cloned AudioSource is missing. Audiosource’s name is Olaylar and how can I equal Olaylar to Missing AudioSource.

Olaylar = gameObject.find(“AudioSourcesName”); I want make something like that.

GameObject.Find is considered slow and generally not the best method.

If your audiosource is on a gameobject in the scene, you can’t reference it to a prefab with drag/drop and have it hold that reference when you create an instance of that prefab, which is what it sounds like is happening.

If the audiosource is on the prefab, you can create a drag/drop reference and it will hold it.

You might consider having a central audio manager that keeps a reference to your audiosources/clips and simply call methods on it to play the proper audio when needed.