Hi, i’ve got this error message - Error CS0029 : Cannot implicitly convert type `UnityEngine.GameObject’ to ‘UnityEngine.Transform’ when i try to run this code…
public void ScaleDownButton() {
Transform model = GameObject.FindWithTag ("Model1");
ScaleDown(model);
model = GameObject.FindWithTag ("Model2");
ScaleDown(model);
model = GameObject.FindWithTag ("Model3");
ScaleDown(model);
}
private void ScaleDown(Transform model) {
Vector3 newScale = new Vector3 ();
newScale.x = Mathf.Clamp(model.localScale.x - scalingSpeed, min.x, max.x);
newScale.y = Mathf.Clamp(model.localScale.y - scalingSpeed, min.y, max.y);
newScale.z = Mathf.Clamp(model.localScale.z - scalingSpeed, min.z, max.z);
model.localScale = newScale;
}