Hi,
I wrote a script that should move my ship according the AddForce. But it says :
//Assets/ControllerMov.cs(23,9): error CS8025: Parsing error
Here is my code:
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
public float speed;
private Rigidbody2D rb;
void Start () {
rb = GetComponent<Rigidbody2D>();
}
void FixedUpdate () {
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector2 movement = new Vector2 (moveHorizontal, moveVertical);
rb.AddForce (movement * speed);
}
I can’t seem to figure out where parsing problem is.