- Home /
Duplicate Question
Parsing error
Why do i get parsing error here? how do i fix it?
using UnityEngine; using System.Collections; using UnityEngine.UI; using System;
public class ShootMeBall : MonoBehaviour { public GameObject go; public float forceadder = 500f; private float slider; private float force; public class ExampleClass : MonoBehaviour { public float hSliderValue = 0.0F;
void OnMouseDown()
{
rigidbody.AddForce (transform.forward * forceadder);
rigidbody.useGravity = true;
}
void Update()
{
if(Input.GetKeyDown(KeyCode.R))
{
go.transform.position = new Vector3(112f, 8f, 153f);
}
}
void reseting()
{
}
void Awake()
{
Debug.Log ("I am awake.");
Screen.lockCursor = true;
gameObject.renderer.material.color = Color.yellow;
}
void OnGUI()
{
hSliderValue = GUI.HorizontalSlider(new Rect(25, 25, 100, 30), hSliderValue, 0.0F, 10.0F);
}
}
Please ensure your code is correctly formatted prior to posting. Please include the full error message you receive, including the line number. Note that the line number in the error will show you exactly where your error is.
It looks like you're declaring two monobehavior-derrived classes in the same script. Not sure that's illegal, but it doesn't make much sense. Use two separate scripts. Your other error is not closing the first class with a }
Thanks for NOT helping me. I found nicer moderators than you guys. I will donate and hope that it will make you better. Thanks for nothing.
@agoHerobrine112211 - Rather than get mad at us, read the FAQ, give us correctly formatted code, and include the error message copied directly from the console so we have a line number. And search first on your error message. Your problem has been addressed a bizillion times. With your nested class, and no explanation of what you are trying to achieve, with the class, there is not much we can do beyond point out a missing '}'.