- Home /
Assets/Tests/CubeDomino/Endscript.js(10,17): BCE0048: Type 'System.Type' does not support slicing.
Hey there, I know, this has been asked alot. And I did found all those other posts, but nothing helped my problem!
This is the script that I use, When it hits one of the objects with the tag "boxhit", it needs to get every gameobject with that tag, and then remove the Hingejoint from that gameobject. So far I can see, it should work, but this strange error keeps coming!
var boxHit : System.Array = System.Array.CreateInstance(GameObject, []);
function OnCollisionEnter (tC : Collision){
if(tC.gameObject.tag == "boxhit"){
boxHit = GameObject.FindGameObjectsWithTag("boxhit"); for (var go : GameObject in boxHit){
GameObject[go].Destroy(GetComponent(HingeJoint));
}
}
}
This is the code, the error is at the line with "GameObject[go].Destroy... ssets/Tests/CubeDomino/Endscript.js(10,17): BCE0048: Type 'System.Type' does not support slicing.
Now, I've already tried to do the following:
I've seen somewhere that I should add New when making the variable, gave me another error, which wanted me to do something and that gave me another one, so, not working for me.
Another answer was, was that you had to change something with the code, because Unity doesn't know what type of variable you throw into the engine, but I didn't understand what I actually had to change, and so here I am.
http://forum.unity3d.com/threads/17089-Type-Object-does-not-support-slicing-(error) (Written by Ncarter, third answer when I remember correctly)
Can someone please help me with this?