//VOID START void Start() { animator = GetComponent <Animator>(); playerStScript = GetComponent <PlayerStats>(); //FIND THE InputFieldGameChat Object and get the InputField COMPONENT inputFieldGameChat = GameObject.Find("InputFieldGameChat").GetComponent <InputField>(); //FIND GAMEMAGER AND ACCESS THE DMGDATABASE SCRIPT GameManager = GameObject.Find("GameManager_mn"); dmgScript = GameManager.GetComponent <DmgDatabase>(); particleScript = GameManager.GetComponent <ParticleManager>(); particleScript.CreateSpawnParticle(this.transform); teleportParticle = particleScript.teleportParticle; if (uLink.Network.isServer) { playerSpellScript = transform.GetComponent <PlayerSpells>(); agent = GetComponentInChildren <NavMeshAgent>(); agent.updateRotation = false; agent.updatePosition = true; initialRotation = transform.rotation; initialPos = transform.position; } if (networkView.isOwner == true) { mainPortrait = GameObject.Find("CharPortrait").GetComponent <Image>(); mainPortrait.sprite = playerStScript.stats.charPortrait; //StartCoroutine(RecallBaseRPC()); GameManager.GetComponent <GameEvents>().PlayGreetingsAudio(); //SEND A REFERENCE OF THE PLAYERSTATS SCRIPT TO THE GAMEEVENTS SCRIPT ATTACHED TO GAME MANAGER OBJ GameManager.GetComponent <GameEvents>().playerStScript = playerStScript; GameObject.Find("LeftPanel").GetComponent <LeftPanelUi>(); playerSpellScript = transform.GetComponent <PlayerSpells>(); //FIND LeftPanel GAMEOBJECT AND GET LeftPanelUi COMPONENT leftPanelScript = GameObject.Find("LeftPanel").GetComponent <LeftPanelUi>(); //FIND QcdUi GAMEOBJECT AND GET CDRUi COMPONENT cdrUiScript = GameObject.Find("CdUi").GetComponent <CDRUi>(); //FIND Qcdr GAMEOBJECT AND GET SHOWCDR COMPONENT cdrUiQScript = GameObject.Find("Qcdr").GetComponent <ShowCDR>(); //FIND Wcdr GAMEOBJECT AND GET SHOWCDR COMPONENT cdrUiWScript = GameObject.Find("Wcdr").GetComponent <ShowCDR>(); //FIND Ecdr GAMEOBJECT AND GET SHOWCDR COMPONENT cdrUiEScript = GameObject.Find("Ecdr").GetComponent <ShowCDR>(); //FIND Rcdr GAMEOBJECT AND GET SHOWCDR COMPONENT cdrUiRScript = GameObject.Find("Rcdr").GetComponent <ShowCDR>(); //FIND EACH ELEMENT OF THE UI TO SHOW HEALTH, MANA AND SPELL LEVELS healthCdImage = GameObject.Find("HpBar").GetComponent <Image>(); manaCdImage = GameObject.Find("ManaBar").GetComponent <Image>(); spellLvlScript = GameObject.Find("SpellsLvl").GetComponent <SpellLvlScript>(); //gameEventScript = gameManager.GetComponent<GameEvents>(); //SET THE CAMERA ACTIVE TO THIS TARGET PLAYER cam = Camera.main; cameraObj = GameObject.Find("Custom_Camera"); cameraScript = cameraObj.GetComponent <CustomCamera>(); cameraScript.sources.target = this.transform; cameraScript.config.cameraActive = true; cameraScript.config.cameraLocked = true; } //playerStScript.stats = playerStScript.stats; }