After MonoDevelop giving up and killing itself 30 mins after I got it working by a complete reinstall I gave up and decided to deal with Visual Studio’s cluttered and utterly disgusting interface so I could code without errors but now half my code is underlined in red that wasn’t a week ago and ugh I don’t even know.
I have an unexpected symbol ‘void’ at line 37 but was at line 46 (magically went away… see what I mean)
and Visual Studio doesn’t recognize the update part in the void. It does however in my other rotation script. (once again see why I am so confused)
Anyway here is a copy of my script and any fixes would be helpful. (I’m very much a beginner at programming so excuse my bad scripting techniques)
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
public Text countText;
public Text winText;
public Keycode ResetKey = Keycode.r;
public string SceneName = "MiniGame";
private Rigidbody rb;
private int count;
void Start ()
{
rb = GetComponent<Rigidbody>();
count = 0;
SetCountText ();
winText.text = "";
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rb.AddForce(movement * speed);
}
}
void Update () {
if (Input.GetKeyDown("r"))
{
Application.LoadLevel(MiniGame);
}
}
void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag(“Pick Up”))
{
other.gameObject.SetActive(false);
count = count + 1;
SetCountText();
}
}
void SetCountText ()
{
countText.text = "Count: " + count.ToString ();
if (count >= 24)
{
winText.text = "You Win!";
}
}
}