Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

How to fix error CS1061:

$
0
0
using UnityEngine; using System.Collections; public class PlayerWeaponController : MonoBehaviour { public GameObject playerHand; public GameObject EquippedWeapon { get; set; } IWeapon equippedWeapon; CharacterStats characterStats; void Start() { characterStats = GetComponent(); } public void EquipWeapon(Item itemToEquip) { if (EquippedWeapon != null) { characterStats.RemoveStatBonus(EquippedWeapon.GetComponent().Stats); Destroy(playerHand.transform.GetChild(0).gameObject); } EquippedWeapon = (GameObject)Instantiate(Resources.Load("Weapon/" + itemToEquip.ObjectSlug), playerHand.Transform.position, playerHand.transform.rotation); equippedWeapon = EquippedWeapon.GetComponent(); equippedWeapon.Stats = itemToEquip.Stats; EquippedWeapon.transform.SetParent(playerHand.transform); characterStats.AddStatBonus(itemToEquip.Stats); } public void PerformWeaponAttack() { equippedWeapon.PerformAttack(); } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>