x


Unexpected token: (. after creating class

Hi,

I created a class, it looks fine but I got this message - "Assets/gScripts/gEnv/grass_classes/grass01.js(6,13): BCE0043: Unexpected token: (." class:

 class Grass01
{

var grass: GameObject;

function get(){
    grass = Resources.LoadAssetAtPath("Assets/sAssets/Grass/grass01/grass01.FBX", GameObject);
    grass.transform.localScale = Vector3(0.3,0.3,0.3);
}
function gClone(x,z,tHight,z_flag){
    get();
    Instantiate(grass, Vector3(x,tHight,z ), Quaternion.Euler(270, z_flag*25, 0));
}
}

Thanks

more ▼

asked Jul 21 '11 at 10:06 PM

2dkot gravatar image

2dkot
82 15 23 28

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

"get" is a bad method name. I think it's a problem here because it might be a reserved word in Unityscript.

more ▼

answered Jul 21 '11 at 10:20 PM

flaviusxvii gravatar image

flaviusxvii
3k 13 19 43

Pretty sure that's the case. I think it's used for creation of custom properties(?): you use them to define how you get and set values.

I could only find references for C# stuff, but it's the same idea, I believe.

Jul 21 '11 at 10:29 PM Chris D
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3570
x35

asked: Jul 21 '11 at 10:06 PM

Seen: 657 times

Last Updated: Jul 21 '11 at 10:29 PM