error CS0501: `CameraMouse.AddComponent()' must have a body because it is not marked abstract, extern, or partial
Alright, I know I've been submitting a lot of questions lately but I seriously could not find an answer to this anywhere. The closest one I've gotten without submitting a question is "update Unity". However, I really don't believe that's the issue. Can you take a look at my code and figure out what's wrong with it? Should I update unity or is there an issue I'm overlooking? This is the last error I need to debug before finishing up the nest version of my game, so it would mean a whole lot if someone would look at it. Here's my code- using UnityEngine; using UnityEngine.UI; using System.Collections;
public class CameraMouse : MonoBehaviour {
public float distance = 5.0f;
public float xSensitivity = 5.0f;
public float ySensitivity = 5.0f;
public float xAngle = 0.0f;
public float yAngle = 0.0f;
public float AddComponent<Transform> ();
void LateUpdate ()
{
// Only if there is a target
if (target) {
if (Input.GetMouseButton (1))
// Update x, y angle with the mouse delta
yAngle -= Input.GetAxis ("Mouse Y") * ySensitivity;
if (Input.GetMouseButton (1))
xAngle += Input.GetAxis ("Mouse X") * xSensitivity;
yAngle = Mathf.Clamp (yAngle, 0, 90);
// Initialize the position to be distance units along the z axis
// away from the target
transform.position = Vector3.forward * distance + target.position;
// Initialize the rotation to look at the target
transform.LookAt (target.position);
// Rotate around the world up axis by the accumulated delta mouse x
transform.RotateAround (target.position, Vector3.up, xAngle);
// Rotate around our own right vector by the accumulated delta mouse y
worldRight = transform.TransformDirection (Vector3.right);
transform.RotateAround (target.position, worldRight, yAngle);
}
}
}
Your answer
Follow this Question
Related Questions
NPC moving on the same tile instead of walking around? 0 Answers
compiler error - playmode 0 Answers
*Solved* Loop instantiating objects causes my Unity Editor to crash 1 Answer
Missing the class attribute 'ExtensionOfNativeClass' 4 Answers
Can someone explain to me how FileUtil.CopyFileOrDirectory works ? 0 Answers