I am very new to unity and have no clue how to make this work, I’ve been working on it for hours.
Here is what I have so far:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityStandardAssets.CrossPlatformInput;
public class PlayerController : MonoBehaviour {
private Rigidbody2D body;
public float speed;
private int count;
public Text counttext;
public Text WinText;
void Start()
{
body = GetComponent<Rigidbody2D> ();
count = 0;
WinText.text = "";
SetCountText ();
}
void FixedUpdate()
{
Vector2 moveVec = new Vector2(CrossPlatformInputManager.GetAxis("Horizontal"),CrossPlatformInputManager.GetAxis("Vertical")) * speed;
body.AddForce (moveVec);
}