using UnityEngine using System Collections public class CursorControll

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using UnityEngine;
using System.Collections;
public class CursorController : MonoBehaviour
{
public float HorizontalSpeed;
void FixedUpdate ()
{
rigidbody2D.AddRelativeForce(new Vector2(Input.GetAxis("Horizontal") * HorizontalSpeed, 0));
}
}