- Home /
Question by
javerwocky · Jan 07, 2016 at 08:24 AM ·
sounds
how to share sound to the network using PUN?
I am currently working in PUN free edition . i want to share the sound with in the 3D object when click . there are given sounds and it works fin but other player cant here it . I am a student please help.
Comment
here is my code belo
using UnityEngine; using System.Collections;
public class drumsounds : Photon.$$anonymous$$onoBehaviour {
public AudioClip Claper;
public AudioClip Snare;
AudioSource m_Source;
[PunRPC]
void Awake()
{
m_Source = GetComponent<AudioSource>();
}
[PunRPC]
void On$$anonymous$$ouseDown()
{
m_Source.clip = Claper;
m_Source.Play();
}
}