I am trying to make an object scale from zero to it's normal size when I instantiate it, so it will look like it popped to the screen.
So when the object start I get it's normal size then update it to zero, and then in update I am scaling it.
This is my code:
void Start()
{
normalScale = transform.localScale;
transform.localScale *= 0.1f;
}
void Update()
{
transform.localScale = Vector3.Lerp(transform.localScale * 0.1f, transform.localScale, 5f * Time.deltaTime);
// destroy item
if (transform.localScale == normalScale)
{
transform.localScale = transform.localScale * 0.1f;
}
}
Thank you.