- Home /
OnPointerClick not getting public variables from script
For some reason my OnPointerClick method can not 'see' the variables
I was trying this script, but it didn't work
then I tried passing a string and viewing it with Debug.Log(...), but that didn't show the string, but empty lines (the variables where set in the inspector by the way)
Does anybody know why I could not get my variable values?
my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
public class Component_ClickCraft : MonoBehaviour, IPointerClickHandler
{
public UnityEvent clicked;
public void OnPointerClick(PointerEventData eventData){
clicked.Invoke();
}
}
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Invoke/Coroutine problems with events 2 Answers
Invoke not working 1 Answer