Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

NetworkBehaviour obsolete ?(Solved)

Discussion in 'Scripting' started by tijanikun, Jan 9, 2019.

  1. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    Hello,
    the new version of unity 2018.3 ruined all my networkbehaviour scripts, what should i use instead now ? im confused...

    Example:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine.Events;
    4. using UnityEngine;
    5. using UnityEngine.Networking;
    6. using UnityEngine.UI;
    7.  
    8. public class MinatoController_Net : NetworkBehaviour
    9. {
    10.     bool chargeStuck = false;
    11.     bool dodgeJumpGroundBool = false;
    12.     bool dodgeJumpCancelCorou = false;
    13.     bool dodgeJumpCanceled = false;
    14.     bool dodgeJumpCancel = false;
    15.     bool heavyWaitBool = false;
    16.     bool WarHeavyStun = false;
    17.     bool canHeavy = true;
    18.     bool HeavyStuckBool = false;
    19.     bool canFoot = false;
    20.     bool afterHoldHeavy = false;
    21.     float startTime = 0f;
    22.     float holdTime = 0.5f;
    23.     public AudioSource Slash;
    24.     public Image imageCooldownAbility1;
    25.     public Image imageCooldownAbility2;
    26.     public Image imageCooldownAbility3;
    27.     public Image imageCooldownAbility4;
    28.     public Image imageCooldownAbility5;
    29.     bool isCoolDown1;
    30.     bool isCoolDown2;
    31.     bool isCoolDown3;
    32.     bool isCoolDown4;
    33.     bool isCoolDown5;
    34.     float SpPerSecond = 5f;
    35.     private float regenSp;
    36.     float ammoPerSecond = 2f;
    37.     private float regenAmmo;
    38.     public RectTransform ammobar;
    39.     [SyncVar(hook = "OnChangeAmmo")] public int currentAmmo = maxAmmo;
    40.     public const int maxAmmo = 100;
    41.     public RectTransform spbar;
    42.     [SyncVar(hook = "OnChangeSp")] public int currentSp = maxSp;
    43.     public const int maxSp = 100;
    44.     bool one_z = false;
    45.     bool timer_running;
    46.     float timer_for_double_z;
    47.     float delay = 0.5f;
    48.     float moveSpeed = 10;
    49.     float dodgeSpeed = 25;
    50.     float jumpForce = 25;
    51.     float fallForce = -10;
    52.     float rasenFall = -15;
    53.     public CharacterController controller;
    54.     float gravityScale = 7;
    55.     public Animator anim;
    56.     public Transform pivot;
    57.     float rotateSpeed = 30;
    58.     float runSpeed = 20;
    59.     float rasenganSpeed = 30;
    60.     float wallSpeed = 30;
    61.     public GameObject Camera1;
    62.     public Camera Camera2;
    63.     bool turning = false;
    64.     public AudioSource MinatoAttackSound;
    65.     public AudioSource ShurikenSound;
    66.     public AudioSource SwordSound;
    67.     public AudioSource Impact2;
    68.     public AudioSource WarpSound;
    69.     private bool teleport = false;
    70.     bool action = false;
    71.     Rigidbody  Rigid;
    72.     float cooldowntime = 30;
    73.     float cooldowntime2 = 6;
    74.     float cooldowntime3 = 2;
    75.     float cooldowntime4 = 4;
    76.     float cooldowntime5 = 1;
    77.     float cooldowntime6 = 1;
    78.     float cooldowntime7 = 0.3f;
    79.     float cooldowntime9 = 1;
    80.     float cooldowntime10 = 1;
    81.     float cooldowntime11 = 20;
    82.     float cooldowntime13 = 25;
    83.     float cooldowntime14 = 2;
    84.     float cooldowntime15 = 2;
    85.     float nextFireTime = 0;
    86.     float nextFireTime2 = 0;
    87.     float nextFireTime3 = 0;
    88.     float nextFireTime4 = 0;
    89.     float nextFireTime5 = 0;
    90.     float nextFireTime6 = 0;
    91.     float nextFireTime7 = 0;
    92.     float nextFireTime8 = 0;
    93.     float nextFireTime9 = 0;
    94.     float nextFireTime10 = 0;
    95.     float nextFireTime11 = 0;
    96.     float nextFireTime13 = 0;
    97.     float nextFireTime14 = 0;
    98.     float nextFireTime15 = 0;
    99.     bool charge;
    100.     public bool canAttack = true;
    101.     bool pushed = false;
    102.     bool WallHited = false;
    103.     bool Down1 = false;
    104.     bool Down2 = false;
    105.     bool downCancel = false;
    106.     bool DownWall = false;
    107.     bool Down3 = false;
    108.     bool downWallFall = false;
    109.     bool canDodge = false;
    110.     bool DashedUltra = false;
    111.     public Transform target;
    112.     private float knockBackCounter;
    113.     private Vector3 moveDirection;
    114.     public GameObject playerModel;
    115.     public GameObject playerminato;
    116.     public GameObject AudioListenerCamera;
    117.     public Transform cameraTransform;
    118.     public Transform cameraTransformSupport;
    119.  
    120.     public MinatoController_Net()
    121.     {
    122.     }
    123.  
    124.     void Start()
    125.     {
    126.         if (!isLocalPlayer)
    127.         {
    128.  
    129.             AudioListenerCamera.SetActive(false);
    130.             Camera2.enabled = false;
    131.             Destroy(this);
    132.             return;
    133.         }
    134.         controller = GetComponent<CharacterController>();
    135.  
    136.     }
    137.        
    I have over 1000 line after that

    Can someone explain please ?
     
  2. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,077
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Unet is being removed soon, probably in 2019.1 You can try switching your existing project over to the Mirror project, which generally requires only a few lines of code. See the thread in the Connected Games forum on Mirror. Unity has a new network solution that is currently released in alpha, but that won't be as easy a conversion.
     
  4. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    ok thank you
     
  5. NarutoU21

    NarutoU21

    Joined:
    Sep 27, 2020
    Posts:
    12
    so whats the answer?
     
  6. Pytez

    Pytez

    Joined:
    Mar 23, 2022
    Posts:
    3
    Switch over to the mirror project