How to make trigger of a scene object work only for local player?
Options
I have an image in-game with a trigger that when player approaches to, will play audio source clip.
Problem is, that when 1 player approaches, it plays the audio for all other players.
The image is " Not " instantiated for network and has " No " PhotonView component on it.
How should I change to have it play the audio only for the local player that approaches and not for any other, if to keep audio source on the image, and not the player.
I think if I use the player, then I can play only if photonView.IsMine, but I would like to play using the Image audio source but without instantiating the image for network, if possible.
Problem is, that when 1 player approaches, it plays the audio for all other players.
The image is " Not " instantiated for network and has " No " PhotonView component on it.
How should I change to have it play the audio only for the local player that approaches and not for any other, if to keep audio source on the image, and not the player.
I think if I use the player, then I can play only if photonView.IsMine, but I would like to play using the Image audio source but without instantiating the image for network, if possible.
0
Best Answer
-
Hi,
You should only allow trigger detection on the local player ( ismine = true) and send an RPC to all client to play that sound, then you don't need any network instantiation for that sound.
Bye,
Jean5
Answers
-
Hi,
You should only allow trigger detection on the local player ( ismine = true) and send an RPC to all client to play that sound, then you don't need any network instantiation for that sound.
Bye,
Jean5