This question was
closed Mar 05, 2017 at 07:13 PM by
AurimasBlazulionis for the following reason:
Not specific enough
Question by
the_greenguy22 · Mar 05, 2017 at 06:11 PM ·
endgame
How do i fix Error CS1525
using UnityEngine;
public class movement : MonoBehaviour {
public Transform camTransform;
public int speed;
public int sprintSpeed;
public int jumpHeight;
void Start ()
{
sprintSpeed = speed * 2;
}
void Update ()
{
transform.rotation = camTransform.rotation;
// This controls the movement
if (Input.GetKey (KeyCode.W)) {
transform.Translate (Vector3.forward * speed * Time.deltaTime);
if (Input.GetKey (KeyCode.LeftShift)) {
transform.Translate (Vector3.forward * sprintSpeed * Time.deltaTime);
}
}
if (Input.GetKey (KeyCode.S)) {
transform.Translate (Vector3.back * speed * Time.deltaTime);
}
if (Input.GetKey (KeyCode.D)) {
transform.Translate (Vector3.right * speed * Time.deltaTime);
}
if (Input.GetKey (KeyCode.A)) {
transform.Translate (Vector3.left * speed * Time.deltaTime);
}
if (Input.GetKey (KeyCode.Space)) {
transform.Translate (Vector3.up * jumpHeight * Time.deltaTime);
}
}
Comment
CS1525 is a syntax error. The console will tell you which line the problem is in, and $$anonymous$$onoDevelop will likely highlight where the error is too.