amaz-e / Wild-West

Practice coop twin-stick shooter
0 stars 0 forks source link

RPC bullets #8

Open amaz-e opened 1 year ago

amaz-e commented 1 year ago

To avoid networking every bullets Gameobject -> [Client] Shoot() ->[Command] CmdShoot() -> RpcShoot()

[ClientRpc(includeOwner = false)] void RpcShoot() { DoShoot(); }

// runs on both server and client, doing different things void DoShoot() { if (isServer) // Carry a physics/scritped bullet

if (isClient)
    // Carry a visual bullet

}