Question by
mrcreeper54321 · Apr 15, 2016 at 04:42 AM ·
c#error messagebug-perhapsstupid
Unexpected symbol error ?
This has to be a bug... Unexpected symbol '}' on lines 18 and 21.
using UnityEngine;
using System.Collections;
public class core : MonoBehaviour {
public static float healthC;
public Rigidbody rb;
public float speed;
void Start () {
healthC = 100;
}
void Update () {
if (healthC <= 0) {
Destroy(gameObject);
}
if (Input.GetKey (KeyCode.W){
rb.AddForce(Vector3.forward * speed * Time.deltaTime, ForceMode.Acceleration);
}
if (Input.GetKey (KeyCode.UpArrow){
transform.Rotate(Vector3.up * speed * Time.deltaTime, Space.World);
}
}
}
Comment
Answer by aditya · Apr 15, 2016 at 04:58 AM
your both GetKey IFs lacking their )
, put one at the end for each of them