So I’m writing a program and have run into a problem with variables.
var someArray : array;
var someVar : CustomClass;
function Update()
{
var tempVar = someVar;
someArray.Push(tempVar);
//call a function which resets someVar
}
What I want is for ‘tempVar’ to be put into the array with the values that ‘someVar’ has during that particular moment. But after I put it into the array it keeps updating itself to whatever the current value of ‘someVar’ is. How do I make this do what I want it to?