ina
1
For some reason, transform.localScale is very slow when app is deployed independently to device, but it works smoothly in Android Remote
I've tried defining a global var to store the transform, but that doesn't make a difference. localScale appears to be dependent on framerate, and I am wondering if there are cons to putting this operation in FixedUpdate instead of Update?
system
3
The slowdown issue is not the GameObject itself which you want to rescale, but its collider. Even if never using the collider, it is actually there and will be updated with a call to transform.localScale result in a more complex scaling.
The collider is used for physics and collision detection, if you do not need this, the solution is quite simple - just destroy the collider of your GameObject.
GameObject.Destroy ( myGameObjectrenderer.collider );
Happy Scaling!
When something is running in the remote it's running on your computer, which is likely 10-50X faster than whatever phone you have.
localScale appears to be dependent on framerate
Nothing is dependent on framerate unless you program it that way. (Or, perhaps, everything is dependent on framerate unless you program it not to be.) In other words, there's nothing special about localScale.
I am wondering if there are cons to putting this operation in FixedUpdate instead of Update?
The usual cons, yes. FixedUpdate should only be used for applying physics forces.