Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Hello. I'm getting this error message. (58,246) CS1525: Unexpected Symbol 'end-of-file'

$
0
0
Here's a copy of my code... I can't seem to figure what the problem is using System.Collections; using System.Collections.Generic; using UnityEngine; public class KeyBoardMoves : MonoBehaviour { public float speed = 5.0f; public float rotateSpeed = 20.0f; public bool canNotMoveSideways = true; void Update () { Movement (); } void Movement() { if (Input.GetKey (KeyCode.UpArrow)) { Debug.Log ("Up arrow is being pressed!"); this.transform.Translate (new Vector3 (0, speed * Time.deltaTime, 0)); } else if (Input.GetKey (KeyCode.DownArrow)) { Debug.Log ("Down arrow is being pressed!"); this.transform.Translate (new Vector3 (0, -speed * Time.deltaTime, 0)); } if (Input.GetKey (KeyCode.LeftArrow)) { if (canNotMoveSideways) { Debug.Log ("You are now rotating left."); this.transform.Translate(new Vector3 (0, -rotateSpeed*Time.deltaTime, 0)); } else { Debug.Log ("Left arrow is being pressed!"); this.transform.Translate (new Vector3 (-speed * Time.deltaTime, 0, 0)); } } else if (Input.GetKey (KeyCode.RightArrow)) { if (canNotMoveSideways) { Debug.Log("You are now rotating right."); this.transform.Translate (new Vector3 (0, rotateSpeed*Time.deltaTime, 0)); } else { Debug.Log ("Right arrow is being pressed!"); this.transform.Translate (new Vector3 (speed * Time.deltaTime, 0, 0)); } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>