Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Error adding onClick Listener via Script

$
0
0
I am getting the following error when adding an OnClick Listener to a button that has been instantiated from a prefab

Type IPointerClickHandler expected Button received. i:0. Argument is out of range.
UnityEngine.EventSystems.EventSystem:Update()

The following code is being used to generate the buttons:
Code (CSharp):
  1.  
  2.         Button buttonClone;
  3.         RectTransform buttonTrans;
  4.         for (int i = 0; i < hullTable.Count; i++)
  5.         {
  6.             buttonClone=...
Error adding onClick Listener via Script

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



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