my problem is that this error me: NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator (System.String operatorName, System.Object lhs, System.Object rhs)
RespawnFirstPerson.Update () (at Assets/Nacho/Scripts/RespawnFirstPerson.js:2)
I think I want a static variable and pass it to another script
RespawnEscalera.js
static var miposicionZ;
miposicionZ = transform.position.z;
static var miposicionZ2;
miposicionZ2 = miposicionZ + 3;
static var miposicionZ3;
miposicionZ3 = miposicionZ -3;
static var miposicionX;
miposicionX = transform.position.x;
static var miposicionX2;
miposicionX2 = miposicionX + 16;
static var miposicionY;
miposicionY = transform.position.y;
RespawnFirstPerson.js
function Update () {
if (transform.position.x > RespawnEscalera.miposicionX transform.position.x < RespawnEscalera.miposicionX2
transform.position.y < RespawnEscalera.miposicionY transform.position.z > RespawnEscalera.miposicionZ2
transform.position.z < RespawnEscalera.miposicionZ3 )
{
transform.position.x = 32;
transform.position.y = 3.5;
transform.position.z = -48;
}
}
With this script I want is that when I move the ladder, do not have to change the coordinates for the respawn
Thanks, I hope you know I answer