This question was
closed May 14, 2016 at 01:39 PM by
NoseKills for the following reason:
The question is answered, right answer was accepted
Question by
jkm8 · Feb 03, 2016 at 06:20 AM ·
2d-platformer
Parsing error?
using UnityEngine; using System.Collections;
public class 2d_controller : MonoBehaviour {
public float moveSpeed = 200;
public float turnSpeed = 1000;
void Update()
{
if (Input.GetAxis("Horizontal")) {
rigidbody2D.AddForce(transform.up * moveSpeed);
}
if (Input.GetAxis("Horizontal")) {
rigidbody2D.AddForce(transform.up * -moveSpeed);
}
if (Input.GetAxis("Vertical")) {
transform.Rotate(Vector3.forward * -turnSpeed);
}
if (Input.GetAxis("Vertical")) {
transform.Rotate(Vector3.forward * turnSpeed);
}
}
Comment