Sorry i tried google it and transform.localscale didn’t actually want what I’m doing. I just want an object to increase overtime… but no tutorial for it. weird haha
Increase what exactly?
it is ok. i figured it out. it is this…
transform.localScale += new Vector3(5, 5, 5) * Time.deltaTime;
but here comes the problem for me, how do i stop it when it reach a certain size? pls tell me
“but here comes the problem for me, how do i stop it when it reach a certain size?”
You wouldn’t just blindly add to your scale;
Add to a variable and when it reaches some value / is over it, stop adding.
Or you can simply read the current scale from object itself, and check if one axis scale is over your max scale.
public void Update()
{
if (transform.localScale.x < 100 )
{
transform.localScale += new Vector3(5, 5, 5) * Time.deltaTime;
}
}
There are tutorials but you have to be careful with the words you choose to feed Google. I was able to find the following video tutorial by searching for just “Unity increase object”, but when I tried to search for “Unity increase object over time” there were no helpful results.
Basically if your search isn’t turning up anything try simplifying the search terms you use and/or adding “Unity”.
thank you sooo much
oh ya i know what you mean. thankss