TronTrail doesn't work in android mode.

I’m newbie for scripts. and I have a problem scripting javascript.

TronTrail in procedural example uploaded by unity tech is not working in the android build setting.

When I switched to android form PC platform, error message pop up in console window.

here are error messages.

“Assets/scripts/TronTrail.js(35,75): BCE0019: ‘time’ is not a member of ‘Object’.” and

“Assets/scripts/TronTrail.js(40,50): BCE0019: ‘point’ is not a member of ‘Object’.”

and also I attach TronTrail script .

can I get advice about solving this problem?

and i’m sorry for rack of my english skill.

var height = 2.0;
var time = 2.0;
var alwaysUp = false;
var minDistance = 0.1;

var startColor = Color.white;
var endColor = Color (1, 1, 1, 0);

class TronTrailSection
{
	var point : Vector3;
	var upDir : Vector3;
	var time : float;
}

private var sections = new Array();


function LateUpdate () {
	var position = transform.position;
	var now = Time.time;

//error!!!!!!!!!!!!!!!!!!!!!!!!!

	// Remove old sections
	while (sections.length > 0 && now > sections[sections.length - 1].time + time) {
		sections.Pop();
	}

	// Add a new trail section
	if (sections.length == 0 || (sections[0].point - position).sqrMagnitude > minDistance * minDistance)
	{
		var section = TronTrailSection ();
		section.point = position;
		if (alwaysUp)
			section.upDir = Vector3.up;
		else
			section.upDir = transform.TransformDirection(Vector3.up);
		section.time = now;
		sections.Unshift(section);
	}
	
	// Rebuild the mesh
	var mesh : Mesh = GetComponent(MeshFilter).mesh;
	mesh.Clear();
	
	// We need at least 2 sections to create the line
	if (sections.length < 2)
		return;

	var vertices = new Vector3[sections.length * 2];
	var colors = new Color[sections.length * 2];
	var uv = new Vector2[sections.length * 2];
	
	var previousSection : TronTrailSection = sections[0];
	var currentSection : TronTrailSection = sections[0];

	// Use matrix instead of transform.TransformPoint for performance reasons
	var localSpaceTransform = transform.worldToLocalMatrix;

	// Generate vertex, uv and colors
	for (var i=0;i<sections.length;i++)
	{
		previousSection = currentSection;
		currentSection = sections*;*
  •  // Calculate u for texture uv and color interpolation*
    
  •  var u = 0.0;		*
    
  •  if (i != 0)*
    
  •  	u = Mathf.Clamp01 ((Time.time - currentSection.time) / time);*
    
  •  // Calculate upwards direction*
    
  •  var upDir = currentSection.upDir;*
    
  •  // Generate vertices*
    

_ vertices[i * 2 + 0] = localSpaceTransform.MultiplyPoint(currentSection.point);_
_ vertices[i * 2 + 1] = localSpaceTransform.MultiplyPoint(currentSection.point + upDir * height);_

_ uv[i * 2 + 0] = Vector2(u, 0);_
_ uv[i * 2 + 1] = Vector2(u, 1);_

  •  // fade colors out over time*
    
  •  var interpolatedColor = Color.Lerp(startColor, endColor, u);*
    

_ colors[i * 2 + 0] = interpolatedColor;_
_ colors[i * 2 + 1] = interpolatedColor;_

  • }*

  • // Generate triangles indices*
    _ var triangles = new int[(sections.length - 1) * 2 * 3];_

  • for (i=0;i<triangles.length / 6;i++)*

  • {*
    _ triangles[i * 6 + 0] = i * 2;_
    _ triangles[i * 6 + 1] = i * 2 + 1;_
    _ triangles[i * 6 + 2] = i * 2 + 2;_

_ triangles[i * 6 + 3] = i * 2 + 2;_
_ triangles[i * 6 + 4] = i * 2 + 1;_
_ triangles[i * 6 + 5] = i * 2 + 3;_

  • }*

  • // Assign to mesh *

  • mesh.vertices = vertices;*

  • mesh.colors = colors;*

  • mesh.uv = uv;*

  • mesh.triangles = triangles;*
    }

@script RequireComponent (MeshFilter)

You have to convert your object from the array before use it :

var sectionTronTrail : TronTrailSection = sections[sections.length - 1];

and use sectionTronTrail after.