Quantcast
Channel: Questions in topic: "namespace"
Viewing all articles
Browse latest Browse all 398

C# error - A namespace can only types and namespace declarations

$
0
0
(edit: when i realized the error and fixed it, it showed another one, could someone please pix this? thank you) I am a newbie to C#, and i do not know what this error is all about, i am trying to edit some variable from the caracter motor script (the one that comes with the caracter controller standard asset) i got this script from elsewhere in this site, i do not know wich post. but anyway, here is the code, the error is right at the start where i declare boolean. (it is in c# ;) ) using UnityEngine; using System.Collections; bool enable = new bool(); bool destroy = new bool(); public class MotorTest : MonoBehaviour { CharacterMotor motor; void Start() { motor = GetComponent(); if(enable) { motor.jumping.baseHeight = 2.0f; if (destroy) { Destroy(gameObject); } } else { motor.jumping.baseHeight = 1.0f; if (destroy) { Destroy(gameObject); } } } }

Viewing all articles
Browse latest Browse all 398

Trending Articles



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