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

C# Parsing Error

$
0
0
Hi, I am getting the message Parsing Error but I don't know what is wrong since it is the only error statement in the console. Please help; below is my script code: using UnityEngine; using System.Collections; public class PlayerController : MonoBehaviour { public float speed; public GUIText countText; public GUIText winText; private int count; void Start () { 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); rigidbody.AddForce (movement * speed * Time.deltaTime); } void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "PickUp") { other.gameObject.SetActive(false); count = count + 1; SetCountText (); } } void SetCountText () { countText.text = "Count: " + count.ToString(); if (count >= 12) { winText.text = "YOU WIN!"; } } void OnTriggerEnter (Collider other){ if (other.gameObject.tag == "NextLevel") { other.gameObject.CompareTag("Player"); Application.LoadLevel("Scene2"); } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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