- Home /
Question by
shubhamgosai · Apr 20, 2021 at 01:23 PM ·
c#unityeditorphotonmultiplayer-networkingpun
Using photon for multiplayer. Button appears for everyone. But it should only appear for the player who has entered the collider.
public Button pianoBtn;
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.tag == "Player")
{
if (!photonView.IsMine)
{
pianoBtn.gameObject.SetActive(true);
return;
}
}
}
Comment
Where u get the photonview? From what I understand the button appear for all player except u. To make it only appear for u, change to photonView.IsMine
don't need !
@REDCRAFT123 thank you for reply. the button appears for everyone. the one who is on the collider and also who isn't on the collider.
Your answer
![](https://koobas.hobune.stream/wayback/20220613032552im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can players host a server individually on your game for free 2 Answers
I am developing a PUN Realtime project. I am having issues with players joining room. 0 Answers
How to check distance between two players (photon multiplayer) 2 Answers
PUN is being incredibly slow in builds 1 Answer
Player Won't Instantiate with Photon Unity Network [PUN] 0 Answers