Javascrip List unexpected token error

Hi im keep getting BCE0043: Unexpected token: … for the List.

import System.Collections.Generic; 

 
@HideInInspector
var pLimbs : List.;
 
var target : Transform;
var pReachLimb : Transform;
var elbowTarget : Transform;
var IsEnabled : boolean = true;
var debug : boolean = true;
var transition : float = 1.0;
 
private var startRotations : List.;
private var targetRelativeStartPosition : Vector3;
private var elbowTargetRelativeStartPosition : Vector3;
private var pIk : GameObject;
 
function Start(){
 
 pLimbs.Clear();
 pLimbs.Add(transform);
 pLimbs.Add(pReachLimb);
    pLimbs.Add(pReachLimb); 
 while (pLimbs[1] != null && pLimbs[1].parent.transform != pLimbs[0]) {
   pLimbs[1] = pLimbs[1].parent.transform;
 }
 
 pIk = new GameObject(name+"-ik");
 pIk.transform.parent = null;
 
 var i : int = 0;
 
 startRotations = new List.();
 startRotations.Clear();
 
 for (i = 0; i < pLimbs.Count; i++) {
      startRotations.Add(pLimbs*.rotation);*

}

targetRelativeStartPosition = target.position - pLimbs[0].position;
if (elbowTarget != null) {
elbowTargetRelativeStartPosition = elbowTarget.position - pLimbs[0].position;
} else {
elbowTargetRelativeStartPosition = Vector3(0,0,0);
}
}

function LateUpdate () {
if (!IsEnabled){
return;
}
CalculateIK2();
}

function CalculateIK2(){
//Lengths and distances.
var i : int = 0;
var lengths : List. = new List.();
lengths.Clear();
var totalLength : float = 0;
var distance : float = Vector3.Distance(pLimbs[0].position, pLimbs[pLimbs.Count-1].position);

pIk.transform.parent = null;

pLimbs[0] = transform;
pLimbs[1] = pReachLimb;
pLimbs[2] = pReachLimb;
while (pLimbs[1] != null && pLimbs[1].parent.transform != pLimbs[0]) {
pLimbs[1] = pLimbs[1].parent.transform;
}

if (pLimbs[2].parent.transform != pLimbs[1]) {
if (!pLimbs[1].GetComponent(“ikLimb”)) {
pLimbs[1].gameObject.AddComponent(“ikLimb”);
pLimbs[1].GetComponent.().pLimbs = new List.();
pLimbs[1].GetComponent.().pLimbs.Clear();
}
pLimbs[1].GetComponent.().target = target;
pLimbs[1].GetComponent.().elbowTarget = elbowTarget;
pLimbs[1].GetComponent.().IsEnabled = IsEnabled;
pLimbs[1].GetComponent.().debug = debug;
pLimbs[1].GetComponent.().transition = transition;
pLimbs[1].GetComponent.().pReachLimb = pReachLimb;
}

for (i = 0; i < pLimbs.Count-1; i++) {
lengths.Add(Vector3.Distance(pLimbs*.position, pLimbs[i+1].position));*
totalLength += Vector3.Distance(pLimbs*.position, pLimbs[i+1].position);*
}

distance = Mathf.Min(distance, totalLength-0.0001);

var adj : float = (Mathf.Pow(lengths[0],2) - Mathf.Pow(lengths[1],2) + Mathf.Pow(distance,2))/(2*distance);

//Debug.Log(adj);

var ikAng : float = Mathf.Acos(adj/lengths[0]) * Mathf.Rad2Deg;

var targetPos : Vector3 = target.position;
var elbowPos : Vector3;

if (elbowTarget != null) {
elbowPos = elbowTarget.position;
} else {
elbowPos = Vector3(0,0,0);
}

//Parents
var parents : List. = new List.();
parents.Clear();

for (i = 0; i < pLimbs.Count; i++) {
parents.Add(pLimbs*.parent);*
}

//Scales
var scales : List. = new List.();
scales.Clear();

for (i = 0; i < pLimbs.Count; i++) {
scales.Add(pLimbs*.localScale);*
}

//Position
var positions : List. = new List.();
positions.Clear();

for (i = 0; i < pLimbs.Count; i++) {
positions.Add(pLimbs*.localPosition);*
}

//Position
var rotations : List. = new List.();
rotations.Clear();

for (i = 0; i < pLimbs.Count; i++) {
rotations.Add(pLimbs*.rotation);*
}

target.position = targetRelativeStartPosition + pLimbs[0].position;

if (elbowTarget != null) {
elbowTarget.position = elbowTargetRelativeStartPosition + pLimbs[0].position;
}

for (i = 0; i < pLimbs.Count; i++) {
pLimbs_.rotation = startRotations*;
}*_

pIk.transform.position = pLimbs[0].position;
pIk.transform.LookAt(targetPos, elbowPos - pIk.transform.position);

var axisCorrections : List. = List.();
axisCorrections.Clear();
for (i = 0; i < pLimbs.Count; i++) {
axisCorrections.Add(new GameObject(pLimbs*.name+“AxisCorrection”));*
}
for (i = 0; i < pLimbs.Count; i++) {
axisCorrections_.transform.position = pLimbs*.position;
if (i != pLimbs.Count-1) {_

_axisCorrections.transform.LookAt(pLimbs[i+1].position, pIk.transform.root.up);
}
if (i == 0) {_

_axisCorrections.transform.parent = pIk.transform;
} else {_

_axisCorrections.transform.parent = axisCorrections[i-1].transform;
}
pLimbs.parent = axisCorrections.transform;
}*_

target.position = targetPos;
if (elbowTarget != null) {
elbowTarget.position = elbowPos;
}

if (elbowTarget != null) {
axisCorrections[0].transform.LookAt(target,elbowTarget.position - axisCorrections[0].transform.position);
axisCorrections[0].transform.localRotation.eulerAngles.x -= ikAng;
axisCorrections[1].transform.LookAt(target,elbowTarget.position - axisCorrections[0].transform.position);
axisCorrections[2].transform.rotation = target.rotation;
} else {
axisCorrections[0].transform.LookAt(target, -axisCorrections[0].transform.position);
axisCorrections[0].transform.localRotation.eulerAngles.x -= ikAng;
axisCorrections[1].transform.LookAt(target, -axisCorrections[0].transform.position);
axisCorrections[2].transform.rotation = target.rotation;
}

for (i = 0; i < pLimbs.Count; i++) {
pLimbs_.parent = parents*;
pLimbs.localScale = scales;
pLimbs.localPosition = positions;
}*_

for (i = 0; i < pLimbs.Count; i++) {
Destroy(axisCorrections*);*
}

transition = Mathf.Clamp01(transition);
for (i = 0; i < pLimbs.Count; i++) {
pLimbs.rotation = Quaternion.Slerp(rotations_, pLimbs*.rotation, transition);
}*_

pIk.transform.parent = transform;
}

Hello,

Your question is very vague and you posted way too much code for it to be useful for fixing a syntax error. It’s also terrible to read with a lack of comments as well as no common syntax style.

It is however quite *easy to find where your problem is: on line 5:

var pLimbs : List.;

So lets analyse that line and figure out why there is an error there:

When the compiler (actually the translator) compiles that line of code, the first thing it does is find out what that piece of code should do. In this case, define a variable, so it splits it up into name and type, which in this case are pLimbs and “List.
pLimbs sounds like a perfectly fine name, so the error must be in the type.

So where does “List.” come from? A “.” in UnityScript signifies a sub-element of some kind, of whatever comes before it. In this case List. is trying to get an undefined sub-element of List. This is where the compiler kinda goes “WTF!!!” and throws an error, because something is undefined that the compiler can’t determine by itself.

Perhaps you should read up how to use Generics in UnityScript. There are a ton of examples out there, you just have to look.

Hope this helps,
Benproductions1