I’m trying to shrink something when it comes in contact with another object and I have no idea why it isn’t working. If you could help me it would be appreciated. Thanks!
Here’s the code that should shrink the game object:
public float targetScale = 0.1f;
public float shrinkSpeed = 2f;
gameObject.transform.localScale = Vector3.Lerp(gameObject.transform.localScale, new Vector3(targetScale, targetScale, targetScale), Time.deltaTime*shrinkSpeed);