now,this is the situation
fisrt ,i write a very simple script ,like this
then ,i compiled it,so this is the error:

i can’t figure out the reason ,please help me
thank you very much
now,this is the situation
fisrt ,i write a very simple script ,like this
then ,i compiled it,so this is the error:

i can’t figure out the reason ,please help me
thank you very much
Your images aren’t showing up for some reason. It’d be nicer for us if you copy-pasted it using tags, anyhow.
PS,the error :
private var camMouseScript : MouseLookRestricted; the name “MouseLookRestricted” does not denote a valid type (“not found”).(BCE0018)
i am waitting on line …………
@zero-wz
please copy and paste your code in the forum so we can see what your problem is.
// like this :P
-S
my code is very simple :
function Awake () {
Screen.SetResolution (1024, 768, false);
}
,
when i complied it ,the MonoDevelop poped up a new js file called “CameraMatch.js”,a error showed in one line of it,
[private var camMouseScript : MouseLookRestricted;]----- the name “MouseLookRestricted” does not denote a valid type (“not found”).(BCE0018)
I think ur GameManager.js script is right.
Another script has problem.
So please post full script of that to solve ur problem.
@zero-wz
Okay, now we’re getting somewhere.
Do you have a script or component called MouseLookRestricted on your gameObject?
-S
this is the full script ,but the question is ,the “CameraMatch.js” isn’t write by me ,i don’t know where it is came from .
var targetLook : Transform; // target to look at
var targetPos : Transform ; // destination to look from
private var source : Vector3 ; // original First person controller position
var animationTime: float = 0.0; // time after the match for some other animation to play / finish playing
private var startTime : float;
private var start : Transform; // starting position/transform
private var end : Transform; // ending position/transform
private var endTime : float = 0.0 ;
var matchTime : float = 1.0 ; // seconds duration of the camera matchXXX
private var isLookAtSmooth = true ; // Smooth look at when matching.
var fPCamera : GameObject; // main camera.
private var camRotX : float ; // store the camera rotation when starting
private var matching: boolean = false ; // so you don’t get interrupted once started
private var justMatched : boolean = false ; // so you know when we are finished
private var camMouseScript : MouseLookRestricted;
function Start () {
fPCamera = GameObject.Find(“Main Camera”);
camMouseScript = fPCamera.GetComponent(“MouseLookRestricted”) ;
endTime = animationTime* -2 ; // fudge factor: turns off cam control at first
}
function Update()
{
if (!matching) return;
if ( Time.time < endTime ) {
// Do movement
var t = ( Time.time - endTime + matchTime ) / matchTime; // Goes from 0 to 1
WaveLike ( t, 9 ) ; // make movement start and end slower- ease-in/ease-out
var toPos = Vector3 ( targetPos.position.x, targetPos.position.y, targetPos.position.z ) ;
transform.position = Vector3.Lerp ( source, toPos , t ) ;
// Do rotation
if ( isLookAtSmooth ) {
// Separate horizontal vertical movement, apply to player cam objects, respectively
// Horizontal
var playerAngle = Mathf.Atan2 ( targetLook.position.x - transform.position.x,targetLook.position.z - transform.position.z ) * Mathf.Rad2Deg ;
var playerRot = Quaternion.AngleAxis ( playerAngle, Vector3.up ) ;
transform.rotation = Quaternion.Slerp ( transform.rotation, playerRot, t ) ;
// Vertical , rotate camera towards target
var targetPoint = targetLook.position;
var targetRotation = Quaternion.LookRotation (targetPoint - fPCamera.transform.position, Vector3.up);
//get distance away from target so you can adjust speed of match
var dist = Vector3.Distance(targetPos.position, transform.position);
fPCamera.transform.rotation = Quaternion.Slerp(fPCamera.transform.rotation,targetRotation, Time.deltaTime * (10-dist));
} // close isLookAtSmooth
justMatched = true ;
// Disable player navigation input while this script controls player position
Input.ResetInputAxes() ;
} // close the original conditional
else {
if ( justMatched ) {
// Keep player input disabled
Input.ResetInputAxes() ;
//report the new rotation back to the mouselook script- very important!
camMouseScript.ResetRotationY ( -1 * fPCamera.transform.rotation.eulerAngles.x ) ;
toPos = Vector3 ( targetPos.position.x, targetPos.position.y, targetPos.position.z ) ;
transform.position = toPos ;
justMatched = false ;
}
if ( Time.time < ( endTime + animationTime ) ) { // if there are other animations to watch
// Keep player input disabled
Input.ResetInputAxes() ;
}
else {
// Done with match. Reset for next time
matching = false;
// enable mouse again
//Screen.lockCursor = false;
// flag for cursor visibility and mouse functions-
gameObject.Find(“Control Center”).GetComponent(GameManager).camMatch = false;
}
} // end else
} // end Update function
static function WaveLike ( tStep, iterations ) {
for ( var i = 0 ; i < iterations ; i++ ) {
tStep = ( 1 - Mathf.Cos ( tStep * Mathf.PI ) ) / 2 ;
}
return tStep ;
}
function Match() {
endTime = Time.time + matchTime ;
source = transform.position ;
// get current camera x
camRotX = fPCamera.transform.rotation.x ;
// disable mouse- this forces the cursor position to the center of the screen
Screen.lockCursor = true;
matching = true; // start the camera match
yield new WaitForSeconds(1.0);
// enable mouse again
Screen.lockCursor = false;
}
i just write the simple js file “GameManager.js”,i have no idea where is the “CameraMatch.js” come from ,so i don’t know MouseLookResTricted stand for,that is the place i confused.
is “CameraMatch.js” a built-in script? when i use the API “Screen.SetResolution” ,so it just pop up and with some strange error?
I can’t say for certain. However,
private var camMouseScript : MouseLookRestricted;
is looking for a component called MouseLookRestricted. Since it can’t find it anywhere, it gives that error.
You said this script wasn’t written by you. The author who wrote the script created another script that was intended to work with this one. If you’re working in a team and another person on your team wrote this script, talk to them about this missing component.
-S
yes ,i found the reason just as you said ,thank you very much^