Author Topic: Send Player Properties (kill\death)  (Read 1777 times)

Elmo loves cookies

  • Jr. Member
  • **
  • Thank You
  • -Given: 60
  • -Receive: 1
  • Posts: 62
    • View Profile
Send Player Properties (kill\death)
« on: October 10, 2016, 07:05:38 PM »
Instance Bomb with (int) ID player owner:
  1. GameObject b = (GameObject)Instantiate(bombPrefab, transform.position, transform.rotation);
  2.             b.SendMessage("setOwner", tno.ownerID);

Bomb Invoke Explode on other player Trigger:
  1.     private void OnTriggerEnter(Collider other)
  2.     {
  3.         if (!dead && other.CompareTag("Bomb"))
  4.         {
  5.             //well Here I have ID Owner Bomb:
  6.             int p = other.GetComponent<Bomb>().owner;
  7.             // and I can take Player like this TNManager.GetPlayer(p), but how I can send him(TNManager.GetPlayer(p) to his properties: int kills++;
  8.             // ?
  9.         }
  10.     }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Send Player Properties (kill\death)
« Reply #1 on: October 11, 2016, 10:47:51 AM »
Object.Instantiate is Unity. It's local.

TNManager.Instantiate is networked. That's what you should be using instead. It doesn't have a return value because all network instantiation is disabled. Pass your parameters to the instantiate function as a part of your custom RCC. Check the tutorials for more information -- this is covered pretty well.