- Home /
Question by
M0N0W0RM · Jun 15, 2017 at 04:47 PM ·
rigidbody2dvelocityscalephysics2d
Scaling an object causes slow movement (Since Update 5.5.4)
Any object with a rigidbody2D attached, which is moved using velocity, slows down whilst using transform.localScale to scale the object. The scaling code I use is:
transform.localScale = new Vector3(Mathf.Lerp(transform.localScale.x, 1, 5 * Time.deltaTime), Mathf.Lerp(transform.localScale.y, 1, 5 * Time.deltaTime), 1);
To clarify, this worked fine before I updated my unity version to 5.5.4. After I updated, the movement is slow and jerky.
Comment
Best Answer
Answer by M0N0W0RM · Jun 15, 2017 at 09:37 PM
I fixed it. Was simply a case of having the scaling done in fixedupdate instead of update!