The question is answered, right answer was accepted
UnityEngine.UI and UnityEngine.EventSystem do not work, what do I do?
hello i am new to unity and im trying to script joystick but i get an error before i even write any functions. I have no clue about anything that is before the public class Script_Name {} because i have never worked with it before.
"'Virtual_Joystick' does not implement interface member 'IPointerClickHandler.OnPointerClick(PointerEventData)'"
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using System.Collections;
public class Virtual_Joystick : MonoBehaviour, IDragHandler, IPointerUpHandler {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
please help, thank you very much!
Answer by Adamcbrz · Sep 08, 2016 at 02:40 AM
You are getting that error because the class is inheriting Interfaces and you have not implemented the methods of those interfaces.
IPointerUpHandler: public void OnPointerUp(EventSystems.PointerEventData eventData);
IDragHandler: public void OnDrag(PointerEventData data);
These are the two methods you need to implement to have the errors go away.