ArgumentException: failed to convert parameters
I get the error in the title when trying to run this code:
public void PhysicalWeaponEquip (UniversalWeaponScript weapon)
{
iconStats = EventSystem.current.currentSelectedGameObject.GetComponent();
weapon = iconStats.iconWeaponID;
es = GameObject.FindGameObjectWithTag("Equiping Manager").GetComponent();
es.currentWeapon = weapon.gameObject;
}
I'm trying to get a certain game object to become the variable of another script through buttons, but it's not working (this is an OnClick() event). Any help would be greatly appreciated, thanks in advance.
Your answer
Follow this Question
Related Questions
Awake alternative for UI button (On-Off) 1 Answer
OnMouseDown work through UI elements 3 Answers
Having issues creating a reset button (Unity 5.3.1) 1 Answer
How to write and return a call for AddListener 1 Answer
[Need help] How to higlight button color when passing the mouse after a click? 1 Answer