The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

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).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Clients not updating gameobject after RPC received.

Webbe
2021-08-02 13:47:31

Hello everyone!

So I'm currently dipping my toes into Photon and Multiplayer, one of the features that I thought could be a good learning experience would be to retrieve the Mesh and Material from a target and then change the client's Mesh and Material and then display that for all users. This would be similar to the Prop Hunt game mode I guess.

So I thought that I would give this a shot and I'm currently struggling to have the other clients see the change of Mesh and Material. It works fine in the editor and you can see on the clients that you've swapped Mesh and Material due to the shadow changing shape.

What I've done so far is to create a few prefabs that have a PhotonView on them, I'm trying to get the game object information from the PhotonViewId.

So here's my Mirror method:

Then we have the actual RPC where I get the game object information and then I change my game object mesh and material if the checks are correct.

We can see from the Debug Log the following:

Sending RPC MirrorProp with the target 2

Sending RPC "MirrorPropRpc" to target: All or player:.

Received RPC: MirrorPropRpc

You have mirrored: Tree03_Yellow

I might just be misunderstanding the workflow of RPCs so any help would be really appreciated.

Comments

Webbe
2021-08-02 14:02:48

So I actually found the problem.. I guess you figure things out when you explain the problem for someone else huh.

The problem was the check if the photon view was mine in the RPC:

When I updated the method:

Then everything works as expected! Thanks, everyone!

Tobias
2021-08-03 09:21:50

Glad you found the cause and could fix it! Thanks for the update, too.

Back to top