Hi… I wrote a code to Zoom-in on an intro Logo
but it’s zoom is with lag…
var yourtexture : Texture;
var NewWidth : float;
var NewHeight : float;
function OnGUI(){
GUI.depth = 1000;
GUI.DrawTexture(Rect((Screen.width/2 - NewWidth/2), (Screen.height/2 - NewHeight/2), NewWidth, NewHeight), yourtexture);
}
function Update() {
NewWidth += Time.deltaTime*20;
NewHeight += Time.deltaTime*10;
}
what is wrong with my code?