How to make an object visible only to one player not the other one
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
How to make an object visible only to one player not the other one
Saharsh
2021-10-28 11:14:59
How to make an object visible only to one player not the other one. photonView.IsMine is not working
Comments
[Deleted User]
2021-10-28 11:18:05
Hey, not really sure what you mean. You can turn the renderer off from an RPC if you want to make it invisible to someone. You can do it from the SerializedRead stream too. There are lots of ways to achieve what I think you're trying to say.
@MeepPun See i want only want to show a UI panel player who got triggered with another object and not to the other players. Pls help
I tried using if(photonView.IsMine) but for some reason it doesn't work
The Code Is Here:
At line 226 at "OnTriggerEnter" function, the if(view.IsMine) statement at line 234.
I only want the player who got collided with another gameobject called shell which has a tag called "Shell". After it collided with the player, i only want to show him a UI Panel not to the other Players. Pls help
You can try changing the location of your trigger method. Move it from the player to the Shell object.
So you will have the next code in the Shell object:
public void OnTriggerEnter(Collider other)
{
if (gameObject == null)
{
return;
}
if (other.CompareTag("Player"))
{
Debug.Log("Player enter the shell");
Obj.SetActive(true);
Destroy(gameObject);
}
}
@Murky thanks, i realized we can also do an RPC
your one also works!
Back to top