Skip to content

Instantly share code, notes, and snippets.

@kirkins
Created July 27, 2019 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkins/6c435a8e0111c26d66d519e0b912808b to your computer and use it in GitHub Desktop.
Save kirkins/6c435a8e0111c26d66d519e0b912808b to your computer and use it in GitHub Desktop.
void FixedUpdate()
{
//rigidBody.AddForce(Vector3.down * 5);
if (direction)
{
transform.localScale += new Vector3(sizeValue, sizeValue, sizeValue) * Time.deltaTime;
sizeCounter++;
if (sizeCounter > 50)
{
direction = !direction;
}
}
else
{
transform.localScale -= new Vector3(sizeValue, sizeValue, sizeValue) * Time.deltaTime;
sizeCounter--;
if (sizeCounter < 2)
{
direction = !direction;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment