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

Error CS1525: Unexpected symbol

$
0
0
I'm trying to learn and understand Unity, started a while ago, and I've been following some tutorials. Still I'm getting the following error: CS1525: Unexpected symbol 'speed' in the line (49,21). using UnityEngine; using System.Collections; public class FPScontroller : MonoBehaviour { public float movementSpeed = 5.0f; public float mouseSensitivity = 2.0f; public float jumpSpeed = 20f; float verticalRotation = 0; public float upDownRange = 60.0f; float verticalVelocity = 0; // Use this for initialization void Start () { Screen.lockCursor = true; } // Update is called once per frame void Update () { CharacterController cc = GetComponent(); //rotation X float rotLeftRight = Input.GetAxis("Mouse X") * mouseSensitivity; transform.Rotate(0, rotLeftRight, 0); //rotation Y verticalRotation -= Input.GetAxis("Mouse Y") * mouseSensitivity; verticalRotation = Mathf.Clamp (verticalRotation, -upDownRange, upDownRange); Camera.main.transform.localRotation = Quaternion.Euler(verticalRotation, 0, 0); //Walking float forwardSpeed = Input.GetAxis("Vertical") * movementSpeed; float sideSpeed = Input.GetAxis("Horizontal") * movementSpeed; verticalVelocity += Physics.gravity.y * Time.deltaTime; Vector3 speed = new Vector3 (sideSpeed, Physics.gravity.y, forwardSpeed) speed = transform.rotation * speed; cc.Move(speed * Time.deltaTime); } } Where/what is the problem?

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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