public void Initialize(BotData data, PrimaryWeaponStats primary, SecondaryWeaponStats secondary, int playerId, Sprite face) { botStats = data; primaryStats = primary; secondaryStats = secondary; var huds = GameObject.Find("PlayerStats").GetComponent <PlayerHudManager>(); playerHud = huds.GetPlayerHud(playerId); playerHud.LoadFace(face); floatHud = Instantiate(FloatingHudPf, Vector3.zero, Quaternion.identity).GetComponent <FloatingHud>(); var secondaryDeplete = 1 / secondaryStats.EffectDuration * Time.deltaTime; floatHud.Initialize(primaryStats.AmmoCap, secondaryDeplete, playerId); floatHud.GetComponent <AnchorHud>().SetAnchor(this.transform); }