So, i was doing the edge collider snow ball challenge and, at some point the idea:
“How i make this snowball grow while it’s moving? Like a real snowball” so i came up with this C# script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BallGrowth : MonoBehaviour
{
//Variable Declaration
[SerializeField] float scalingX = 0f;
[SerializeField] float scalingY = 0f;
[SerializeField] float scalingZ = 0f;
void Update()
{
if (GetComponent<Rigidbody2D>().velocity.y > 0)
{
transform.localScale += new Vector3(scalingX, scalingY, scalingZ) * Time.deltaTime;
}
}
}
BUT the ball still grow even if the velocity is 0, what i’ve done wrong?