- Home /
This question was
closed Jun 07, 2014 at 09:32 PM by
Graham-Dunnett for the following reason:
Duplicate Question - http://answers.unity3d.com/questions/145012/bce0019-component-is-not-a-member-of-unityengineco.html
Question by
Pescu · Jun 07, 2014 at 09:20 PM ·
javascriptbce0019
BCE0019: 'NextLap' is not a member of 'UnityEngine.Component'. On PC build work fine, only when i use android build give me this error
static var playerTransform : Transform; //Store the player transform
private var raceTypeObj : GameObject;
private var raceType : Component;
function Start ()
{
playerTransform = gameObject.Find("Main_Camera").transform; //Set the player transform
raceTypeObj = GameObject.Find("Main_Camera");
//GetComponent(FreeRace);
}
function OnTriggerEnter (other : Collider)
{
//Is it the Player who enters the collider?
if (!other.transform.parent.CompareTag("Player"))
return; //If it's not the player dont continue
//Is this transform equal to the transform of checkpointArrays[currentCheckpoint]?
if (transform == playerTransform.GetComponent(CarCheckpoint).checkPointArray[CarCheckpoint.currentCheckpoint].transform)
{
/*if(raceType!=null)
raceType.checkPointNr = raceType.checkPointNr + 1;*/
//Check so we dont exceed our checkpoint quantity
if (CarCheckpoint.currentCheckpoint+1 <playerTransform.GetComponent(CarCheckpoint).checkPointArray.length) {
//Add to currentLap if currentCheckpoint is 0
if(CarCheckpoint.currentCheckpoint == 0)
{
CarCheckpoint.currentLap++;
if((CarCheckpoint.currentLap>1) && (raceType!=null))
GetComponent(raceType.name).NextLap();
}
CarCheckpoint.currentCheckpoint++;
} else {
//If we dont have any Checkpoints left, go back to 0
CarCheckpoint.currentCheckpoint = 0;
}
visualAid(); //Run a coroutine to update the visual aid of our Checkpoints
}
}
function setRaceType(newRT : Component)
{
raceType = newRT;
}
function visualAid () {
//Set a simple visual aid for the Checkpoints
for (objAlpha in playerTransform.GetComponent(CarCheckpoint).checkPointArray) {
objAlpha.renderer.material.color.a = 0.2;
}
playerTransform.GetComponent(CarCheckpoint).checkPointArray[CarCheckpoint.currentCheckpoint].renderer.material.color.a = 0.8;
}
Comment
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
"x" is not a member of 'function(): void'. 0 Answers
Javascript class function is not a member of the class. BCE0019 0 Answers
dropdown menu error 1 Answer
Assets/Scripts/AI Scripts/AICarScript.js(45,33): BCE0019: 'position' is not a member of 'Object'. 0 Answers