- Home /
Script Error
It´s my first project and I can´t test it cos a few error:
1# Assets/Scripts/FirstPerson.cs(28,1): error CS8025: Parsing error 2# Assets/Scripts/FirstPerson.cs(14,9): error CS1519: Unexpected symbol `{' in class, struct, or interface member declaration 3# Assets/Palace of Orinthalian/Standard Assets/Character Controllers/Sources/Scripts /ThirdPersonController.js(193,54): UCW0003: WARNING: Bitwise operation '|' on boolean values won't shortcut. Did you mean '||'?
Script:
//using UnityEngine; //using System.Collections;
public class FürstPerson : MonoBehaviour { public float movementSpeed = 5.0f; // Use this for initialization void Start() {
}
{ // Update is called once per frame void Update () {
float forwardSpeed = Input.GetAxis ("Vertical") * movementSpeed; float sideSpeed = Input.GetAxis ("Horizontal") * movementSpeed; Vector3 speed = new Vector3 (sideSpeed, 0, forwardSpeed); CharakterController = cc .GetComponent<CharacterController>(); cc.SimpleMove ( speed ) ;
}
If you got a Answer please don´t blame me for mistakes or bad english
Answer by hbalint1 · May 10, 2015 at 10:30 PM
it's just bad using of '{' and '}' braces. Here's the fixed script:
using UnityEngine;
using System.Collections;
public class FürstPerson : MonoBehaviour {
public float movementSpeed = 5.0f;
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update () {
float forwardSpeed = Input.GetAxis ("Vertical") * movementSpeed;
float sideSpeed = Input.GetAxis ("Horizontal") * movementSpeed;
Vector3 speed = new Vector3 (sideSpeed, 0, forwardSpeed);
CharakterController = cc .GetComponent<CharacterController>();
cc.SimpleMove ( speed ) ;
}
}
Your answer
Follow this Question
Related Questions
Error : GPGSUpgrader.cs(194,80): warning CS0162: Unreachable code detected 0 Answers
All scripts in unity have stopped working 1 Answer
Migration from Unity 5.5.0f3 to Unity 2017- error and HoloLens app not building 0 Answers
how to solve -- Object reference not set to an instance of an object -- ? 3 Answers