- Home /
Unity 4.5 LocalScale Changes (2D)
This was working before upgrading to Unity 4.5. After a collision (ontriggerenter2d), the object hit got smaller. Now, collision is still detected (per debug.log), but it's not rescaling. Are there changes needed to my script for Unity 4.5? I tried instead destroy, and this works, so it's not the collision Is there some setting that locks or enables localScale changes? a new way for Unity4.5???
Anyone???
Vector3 theScale = other.gameObject.transform.localScale; // tried changing to Vector2
theScale.x *= shrinkPerHit;
theScale.y *= shrinkPerHit;
other.gameObject.transform.localScale = theScale;
Answer by vickygroups · Jun 07, 2014 at 05:45 PM
Looks like, in Unity 4.5, it requires a much bigger float number change - in 4.4, I needed to go down by 0.5%, vs. by 20-30% in 4.5. I had attributed the original low number to the fact that the spray is an animation, so each spray hits the food multiple times (if that makes sense to you). No clue as to why this would suddenly change. But glad it's working!