iTween.ValueTo problems with camera.orthographicSize

I am trying to alter my orthographic camera’s size over time using iTween like so…

iTween.ValueTo (Camera.main.gameObject, iTween.Hash (“from”, Camera.main.orthographicSize,
“to”, ((float)cols) - 0.03f,
“time”, 1f,
“easetype”, iTween.EaseType.easeInExpo,
“onupdate”, “UpdateOrthographicCameraSize”,
“onupdatetarget”, Camera.main.gameObject));

void UpdateOrthographicCameraSize (float size) {
Camera.main.orthographicSize = size;
}

However, the update method is not being called but I don’t see what the problem is.

Hi, The problem is “onupdatetarget”, Camera.main.gameObject , change Camera.main.gameObject to gameObject .
It should be the gameObject that script is running on it.
it works for me :slight_smile:

I’m sure he figured it out years ago by now.