- Home /
hey why when i try to script it always says parsing error
this my script=using UnityEngine; using System.Collections;
public class Movimiento1 : MonoBehaviour {
public Vector2 speed = new Vector2(50,50);
private Vector2 velocity;
void Update () {
float inputX = 0;
float inputY = 0;
inputX = Input.GetAxis("Horizontal");
inputY = Input.GetAxis("Vertical");
//Ahora muevo segun la direccion
// I already got the module(speed vector) and now I got the direction represented with the variables inputX and inputY,
//so now i cant mae the velocity vector:
velocity = new Vector2(speed.x * inputX, speed.y * inputY);
void FixedUpdate() {
rigidbody2D.velocity = velocity;
Comment
Answer by NeverHopeless · Jul 06, 2015 at 04:48 AM
The problem as I see is due to the missing }
just above void FixedUpdate()
definition.
Try this out:
//// .... Update code
velocity = new Vector2(speed.x * inputX, speed.y * inputY);
} // <---------- Missing bracket
void FixedUpdate() {
////... Fixed update code
}
Answer by Malleck666 · Jul 06, 2015 at 05:37 AM
Have you closed all your braces in your actual script?