Instantiate Problem


var colpiPrefab : Transform;

function Update ()
var colpi = Instantiate(colpiPrefab, transform.Find(“Respawn”).transform.position, Quaternion.identity);
colpi.rigidbody.AddForce(transform.forward * 2000);

When i try to use this js unity send me some error:
BCE0043: Unexpected token: var.
UCE0001: ‘;’ expected. Insert a semicolon at the end.

What’s wrong with this?

It is a typo. Check your if statement.


You have put a semicolon. Remove it.