Empty a vector3 Array

Hi guys,

in one of my scripts I create a vector3 array :

private var listPoints:Vector3[];

Later in the code I copy the data from another vector3 array :

listPoints=points;

How do I empty the array?

I’ve tested listPoints.Clear but the console display this error:

Expressions in statements must only be executed for their side-effects.

Thanks in advance :wink:

listPoints = null;

I feel a little bit stupid. :slight_smile:
Off course it work

Thanks!

That doesn’t copy the data; you’re just assigning the same array to a different variable. You can use System.Array.Copy to actually copy array data to a new array.

–Eric

Yes, I missused the word, I’m assigning it and that’s what I want to do, not copy the data :wink:

Thanks :wink: