В общем, по видео написал такой скрипт:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class buttonClick : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public void OnPointerDown(PointerEventData eventData) {
if(gameObject.name == "right") {
GameObject.FindWithTag("Player").GetComponent<Player>().move = 1;
}else if(gameObject.name == "left") {
GameObject.FindWithTag("Player").GetComponent<Player>().move = -1;
}
Debug.Log(GameObject.FindWithTag("Player").GetComponent<Player>().move);
}
public void OnPointerUp(PointerEventData eventData) {
GameObject.FindWithTag("Player").GetComponent<Player>().move = 0;
}
}
Но кнопки просто не реагируют на мои клики, что делать?