I keep getting this error and I know is because of #pragma strict.
Can anybody help with fixing the script. Thank you!
Chepe
Assets/_Scripts/Player/FalloutDeath.js(7,56): BCE0019: ‘FalloutDeath’ is not a member of ‘UnityEngine.Component’.
function OnTriggerEnter (other : Collider)
{
// Player fall out!
if (other.GetComponent (ThirdPersonStatus))
{
other.GetComponent (ThirdPersonStatus).FalloutDeath(); //error line
}
// Kill all rigidibodies flying through this area
// (Props that fell off)
else if (other.attachedRigidbody)
Destroy(other.attachedRigidbody.gameObject);
// Also kill all character controller passing through
// (enemies)
else if (other.GetType() == typeof(CharacterController))
Destroy(other.gameObject);
}
// Auto setup the pickup
function Reset ()
{
if (collider == null)
gameObject.AddComponent(BoxCollider);
collider.isTrigger = true;
}
@script AddComponentMenu(“Third Person Props/Fallout Death”)
I can see my spaceship crashing in the floor and then respawning again and again. But is not running on the Iphone and it has giving me the following error;
Assets/_Scripts/Player/FalloutDeath.js(7,79): BCE0019: ‘FalloutDeath’ is not a member of ‘ThirdPersonStatus’.
function OnTriggerEnter (other : Collider)
{
// Player fall out!
if (other.GetComponent (ThirdPersonStatus))
{
(other.GetComponent (ThirdPersonStatus) as ThirdPersonStatus).FalloutDeath(); //other.GetComponent (ThirdPersonStatus).FalloutDeath();
}
// Kill all rigidibodies flying through this area
// (Props that fell off)
else if (other.attachedRigidbody)
Destroy(other.attachedRigidbody.gameObject);
// Also kill all character controller passing through
// (enemies)
else if (other.GetType() == typeof(CharacterController))
Destroy(other.gameObject);
}
// Auto setup the pickup
function Reset ()
{
if (collider == null)
gameObject.AddComponent(BoxCollider);
collider.isTrigger = true;
}
@script AddComponentMenu(“Third Person Props/Fallout Death”)
// ThirdPersonStatus: Handles the player's state machine.
// Keeps track of inventory, health, lives, etc.
var health : int = 6;
var maxHealth : int = 6;
var lives = 4;
// sound effects.
//var struckSound: AudioClip;
//var deathSound: AudioClip;
private var levelStateMachine : LevelStatus; // link to script that handles the level-complete sequence.
private var remainingItems : int; // total number to pick up on this level. Grabbed from LevelStatus.
function FalloutDeath (){
respawnPosition = Respawn.currentRespawn.transform.position;
Camera.main.transform.position = respawnPosition - (transform.forward * 4) + Vector3.up;
transform.position = respawnPosition + Vector3.up;
}