I don’t know why i get this error
Assets/Scripts/Decal.js(13,33): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘float’.
#pragma strict
var respawnTimer = 0.0;
var delayTime = 20.0;
var Player : PlayerStatusController;
var curTransform = gameObject.GetComponent(Transform);
var sqrDistance;
function Update() {
respawnTimer += Time.deltaTime;
if (respawnTimer > delayTime) {
if (!renderer.isVisible) {
sqrDistance = (transform.position - curTransform.position).sqrMagnitude;
if (sqrDistance > 20.0f) {
Destroy(this.gameObject);
}
}
}
}