Networking: RPC To Specific Player?

I’m new to networking and have got a game working where me and my friends can fly planes together. To add bullets and nametags, each plane needs to be identified. I have a few questions.

  1. How do I speak specifically to one object, in everybody’s game? Like if Plane A shoots Plane B, I want to send an RPC call to all clients (from the server) saying that Plane B is to take damage. The RPC call will trigger on every plane, so how do I specify a specific plane?

  2. The planes have a networkview on their transform. They fly fairly smoothly but there is definite jitter. How can I make them fly smoothly? Prediction?

Thanks a ton!

For starters Ive only used Photon Network, not Unity’s Networking but they are quite similar.

For 1, you can choose the Network Player of the the RPC, check the bottom: Unity - Scripting API: NetworkView.RPC

For 2, Yeah that will happen if its just the transform. What you want to do is make a custom script to sync the transform smoothly. Ive used this all the time:

using UnityEngine;
using System.Collections;

public class NetworkTransform : Photon.MonoBehaviour {
    private Vector3 correctPlayerPos =; // We lerp towards this
    private Quaternion correctPlayerRot = Quaternion.identity; // We lerp towards this

    void Update() {
        if (!photonView.isMine) {
            transform.position = Vector3.Lerp(transform.position, this.correctPlayerPos, Time.deltaTime * 5);
            transform.rotation = Quaternion.Lerp(transform.rotation, this.correctPlayerRot, Time.deltaTime * 5);

    void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {
        if (stream.isWriting) {
            // We own this player: send the others our data
        } else {
            // Network player, receive data
            this.correctPlayerPos = (Vector3)stream.ReceiveNext();
            this.correctPlayerRot = (Quaternion)stream.ReceiveNext();

What this does is it smoothly moves to the most recent rotation and position received as well as sending it out. Just make this what the network view is listening to. This is also for PhotonNetwork, so no copy+pasting, but hopefully it can put you on the right track!

I usually extend this so I can sync anything else needed. Its as simple as adding the variables in those 4 places. Good luck!