Search Unity

Assets/Scripts/PlayerMovement.cs(26,26): error CS1501: No overload for method `OnPointerClick' takes

Discussion in 'Scripting' started by kelvinwop, Jan 31, 2015.

  1. kelvinwop

    kelvinwop

    Joined:
    Dec 15, 2014
    Posts:
    36
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerMovement : MonoBehaviour
    5. {
    6.     public UnityEngine.UI.Button left;
    7.     public UnityEngine.UI.Button right;
    8.     public UnityEngine.UI.Button down;
    9.     // Use this for initialization
    10.     void Start()
    11.     {
    12.  
    13.     }
    14.    
    15.     // Update is called once per frame
    16.     void Update()
    17.     {
    18.         if (left.OnPointerClick())
    19.         {
    20.             moveLeft();
    21.         }
    22.         if (right.OnPointerClick())
    23.         {
    24.             moveRight();
    25.         }
    26.         if (down.OnPointerClick())
    27.         {
    28.             moveDown();
    29.         }
    30.     }
    31.     void moveLeft()
    32.     {
    33.  
    34.     }
    35.     void moveRight()
    36.     {
    37.  
    38.     }
    39.     void moveDown()
    40.     {
    41.  
    42.     }
    43.    
    apparently I'm missing a parameter called "eventData" in OnPointerClick()
    what is eventdata and how can I get it?
     
  2. Dameon_

    Dameon_

    Joined:
    Apr 11, 2014
    Posts:
    542
    That's not how OnPointerClick works. Google it. There's plenty of examples.
     
  3. kelvinwop

    kelvinwop

    Joined:
    Dec 15, 2014
    Posts:
    36
    what is a function that can test for clicks/taps then?
     
  4. kelvinwop

    kelvinwop

    Joined:
    Dec 15, 2014
    Posts:
    36
    everything I search for is for the old GUI system