When making a 2D sport in Unity, it is usually essential to have a digital camera that follows the participant’s motion. The SmoothDamp operate can be utilized to create a easy digital camera comply with impact, but it surely can be computationally costly. In the event you’re on the lookout for a strategy to create a easy digital camera comply with impact with out utilizing SmoothDamp, there are a couple of totally different approaches you may take.
One strategy is to make use of the LateUpdate operate. LateUpdate known as in spite of everything different Replace capabilities have been known as, so it is a good place to replace the digital camera’s place. To make use of LateUpdate to create a easy digital camera comply with impact, you may merely set the digital camera’s place to the participant’s place plus an offset. The offset can be utilized to regulate how far the digital camera is behind the participant.