Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Feature Request: send RPC to specific Component

$
0
0
Enjoying Photon a lot! I'm mostly using it to send RPCs to the "paired" GameObject on the other clients.

One thing I ran into this morning (and can't find a natural solution to) is the following. Imagine I have two copies of a behavior on a GameObject, like so:

WizardGameObject
- WizardBehavior
- CastFireBallBehavior
- CastHealBehavior (for expensive burst heals)
- CastHealBehavior (for cheap slow heals)

In other words, along with various behaviors, a wizard has two copies of CastHealBehavior with different params. When one of these sends an RPC like "StartHeal", the paired GameObject errors (correctly) that both instances of CastHealBehavior are receiving the RPC on the other side. This is leading to some hack code on my part for now (and errors in the log on each call).

I think that if I could send RPCs between behaviors, not just gameObjects, I'd use it even when I didn't have to. :wink: Then I could have a generic RPC like "fire" and all my behaviors could send/receive it without confusing each other.

[I'm imagining and implementation where the behavior id is sent under the covers along with photon's viewId. The receiver can use this to find the correct behavior.]

Thanks!

Viewing all articles
Browse latest Browse all 8947

Trending Articles