**I can’t seem to explain why this script is not working in both ways… If i call the function Scaleplus, my object scales 6.66 times bigger, but if call the function Scaleminus it wont do a thing… I’m pretty sure it has something to do with the time values but i can’t make it work. Please help. Thanks
var startScale = Vector3(1,1,1);
var endScale = Vector3(6.66,6.66,6.66);
var t = 0.0;
var speed = .5;
function Scaleplus () {
while (t < 1.0) {
t += Time.deltaTime * speed;
transform.localScale = Vector3.Lerp(startScale, endScale, t);
yield;
}
}
function Scaleminus () {
while (t < 1.0) {
t += Time.deltaTime * speed;
transform.localScale = Vector3.Lerp(endScale, startScale, t);
yield;
}
}