Okey , so I want to add buttons to my pc game. My character is working fine with keyboard. I watched couple of videos about adding buttons. Later I created 2 buttons for left and right and added “AxisTouchButton.cs” script (from Standard Assets - Cross Platform Inputs) to these buttons ,set to horizontal settings -1 for left and +1 for right button. I also edited movement script that attached to player. But nothings is happening. What am i doing wrong?
//using System.Collections;
//using System.Collections.Generic;
//using UnityEngine;
//using UnityStandardAssets.CrossPlatformInput;
public class move : MonoBehaviour
{
float horizontal;
void Start()
{
}
void Update()
{
horizontal = CrossPlatformInputManager.GetAxis("Horizontal");
transform.Translate(Vector3.right * Time.deltaTime * 20.0f * horizontal);
}
}