- Home /
Duplicate Question - http://answers.unity3d.com/questions/topics/bce0018.html
BCE0018: The name 'MouseLook' does not denote a valid type
Here's the error(s) I keep receiving:
Assets/Scripts/RespawnMenuV2.js(5,20): BCE0018: The name 'MouseLook' does not denote a valid type ('not found')
Assets/Scripts/RespawnMenuV2.js(6,20): BCE0018: The name 'MouseLook' does
not denote a valid type ('not found')
Here's my script:
ragma strict
var lookAround01 : MouseLook; var lookAround02 : MouseLook; var charController : CharacterController; var sprintAndCrouch : SprintAndCrouch;
var respawnTransform : Transform;
static var playerIsDead = false;
function Start () { lookAround01 = GameObject.GetComponent(MouseLook); lookAround02 = GameObject.Find("MainCamera").GetComponent(MouseLook); charController = gameObject.GetComponent(CharacterController); }
function Update () { if (playerIsDead == true) { lookAround01.enabled = false; lookAround02.enabled = false; charController.enabled = false; sprintAndCrouch.enabled = false; } }
function OnGUI () { if (playerIsDead == true) { if (GUI.Button(Rect(Screen.width*0.5-50, 200-20, 100, 40), "Respawn")) { RespawnPlayer(); }
if (GUI.Button(Rect(Screen.width*0.5-50, 240, 100, 40), "Menu"))
{
Debug.Log("Return to Menu");
}
}
}
function RespawnPlayer () { transform.position = respawnTransform.position; transform.rotation = respawnTransform.rotation; gameObject.SendMessage("RespawnStats"); lookAround01.enabled = true; lookAround02.enabled = true; charController.enabled = true; playerIsDead = false; Debug.Log("Player has respawned"); }
@script RequireComponent(CharacterController)
Does anyone know what I have done wrong? Help would be appreciated. I do recall changing something without realising and after that the script didn't work. Thanks in advance.
(5,20) = Line 5, Character 20. (6,20) = Line 6, Character 20.