I have this if statement, set up the same way as all my other ones (near the bottom), but it’s not working. Why?
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public GameObject pBody;
public Vector3 offset;
public static bool Increase;
// Use this for initialization
void Start() {
Increase = false;
offset = transform.position - pBody.transform.position;
}
// Update is called once per frame
void Update() {
transform.position = pBody.transform.position + offset;
}
if (Increase == true){
//some action
}
}
I keep getting these errors:
-
Assets/Scripts/CameraController.cs(30,6): error CS1519: Unexpected symbol `if' in class, struct, or interface member declaration -
Assets/Scripts/CameraController.cs(30,19): error CS1519: Unexpected symbol `==' in class, struct, or interface member declaration -
Assets/Scripts/CameraController.cs(36,1): error CS8025: Parsing error
I'll take a look at these.
– wesleywh