android - Void Update not updating enough fast -


i'm trying create camera android game can zoom , move on x axis , want make limit camera. example, want camera stop zooming when orthographicsize bigger variable max_zoom or smaller variable min_zoom.

the problem if user zooms fast, update function doesn't update enough fast , example, orthographicsize equals 0.995 if min_zoom variable equals 1. here condition :

if(getcomponent<camera> ().orthographicsize > min_zoom && getcomponent<camera> ().orthographicsize < max_zoom) {     // .. change orthographic size based on change in distance between touches.     getcomponent<camera> ().orthographicsize += deltamagnitudediff * orthozoomspeed;      // make sure orthographic size never drops below zero.     getcomponent<camera> ().orthographicsize = mathf.max(getcomponent<camera> ().orthographicsize, 0.1f);  } 

so problem user can't zoom out.

okay found solution zoom. removed condition, , @ end of script, used mathf.clamp set orthographicsize between min_zoom , max_zoom. last problem have it's not zoom, can't make fix limit @ right , @ left because when zoom, coordonates of limit changes, that's subject of topic. thank answers anyway.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -