Correct way to do bullets

Hi,

In Sean Riley’s Unite 2014 networking video, he says that bullets are fire and forget and we do not need to sync them across the network but he ends up adding NetworkTransform to the bullet prefab.

In my opinion, there should not be a need for a NetworkTransform as well. So I was wondering how you handle bullets in your game so I can use your advice for mine.

I rather do not use NetworkTransform since they will put a lot of load on the server as there are a lot of them in my game but I can’t find the way how to do bullets without NetworkTransform.

Please keep in mind that in my game there are like 8-10 bullets on the screen at the same time at most and they tend to move very fast and have low life time (very fast paced shooter game).

If they move fast enough to justify using a raycast, thats probably the way to go instead.

I’m using this, what do you think:

using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class SyncPositionWithLerp : NetworkBehaviour
{
  [SyncVar]
  private Vector3 syncPos;

  public float LerpRate = 15;

  void FixedUpdate()
  {
  TransmitPosition();
  LerpPosition();
  }

  void LerpPosition()
  {
  if (!isLocalPlayer)
  transform.position = Vector3.Lerp(transform.position, syncPos, Time.deltaTime * LerpRate);
  }

  [Command]
  void CmdProvidePositionToServer(Vector3 pos)
  {
  syncPos = transform.position;
  }

  [ClientCallback]
  void TransmitPosition()
  {
  CmdProvidePositionToServer(transform.position);
  }

}