Unexpected token: ..

I’ve been having much success with Unityscript so far, but suddenly something this basic has stumped me. I’m trying to create variables within this one to store some information I’ll use later, but I’m getting “Unexpected token: …”.

var AK47 = {};
var AK47.x = 0;
var AK47.y = 0;
var AK47.z = 0;

Try:

var Vector3 AK47 = new Vector3;
var AK47.x = 0;
var AK47.y = 0;
var AK47.z = 0;

In C#, and in UnityScript:

var AK47 : Vector3;
var AK47.x = 0;
var AK47.y = 0;
var AK47.z = 0;

It’s not really clear what you want to do. If you want AK47 to have a x, y and z you could use a Vector3. I assume this is C#, if it isn’t you should consider adding a tag indicating the language you are using.

var AK47 = new Vector3();
AK47.x = 0;
AK47.y = 0;
AK47.z = 0;