Hi I’m error BCE0044: unexpected char: 0xFFFD.
I’m new around here, I flew in on The Unity 3 Beta.
I’m a brand new error from nowhere. But enough of me talking about me, why don’t you talk about me for a bit?
This line
var objBehaviour:behaviour=hit.transform.GetComponent(typeof(behaviour));
line 32
private var mainCamera: Camera;
var raycastDistanceNPC=5.0;
var raycastDistanceLoot=5.0;
var HitMaskNPC: LayerMask;
var HitMaskLoot: LayerMask;
function Start(){
yield;
mainCamera=GetComponent(typeof(Camera));
}
//This script raycasts out from the playerview upon clicking on the screen.
//It then sends a message out to the object touched, and says to that object, "DoStuff()"
//The DoStuff function has a string Variable which can be set to activate whatever other behaviour exists on that entity,
//on another script on that object. Neat huh? :-)
function Update(){
for (var i = 0; i < iPhoneInput.touchCount; ++i) {
if (iPhoneInput.GetTouch(i).phase == iPhoneTouchPhase.Began) {
//print ("test");
var touch = iPhoneInput.GetTouch(0);
var hit : RaycastHit;
if (Physics.Raycast(mainCamera.ScreenPointToRay(touch.position),hit, raycastDistanceNPC, HitMaskNPC)) {
// if (Physics.Raycast (transform.position, Vector3.forward, Mathf.Infinity, layer))
// print ("The ray hit the player");
print(hit.transform.name);
var objBehaviour:behaviour=hit.transform.GetComponent(typeof(behaviour));
if(objBehaviour)
{
print(hit.transform.name + "test");
objBehaviour.DoStuff();
return;
}else
return;
}
else if (Physics.Raycast(mainCamera.ScreenPointToRay(touch.position), hit, raycastDistanceLoot, HitMaskLoot)) {
// if (Physics.Raycast (transform.position, Vector3.forward, Mathf.Infinity, layer))
// print ("The ray hit the player");
print(hit.transform.name);
var objBehaviour2:behaviour=hit.transform.GetComponent(behaviour);
if(objBehaviour2)
{
print(hit.transform.name + "test");
objBehaviour2.DoStuff();
return;
}else
return;
}
print ("Raycast hit nothing");
}return;
}return;
}
Thanks for any tips
AC