Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - benswinden

Pages: [1]
1
Support / Smoothdamp
« on: August 03, 2013, 07:53:19 pm »
I'm using Vector3.SmoothDamp to do smooth camera movement with a tk2dCamera. As the camera moves, all my sprites jiggle slightly. Can you give any insight into why this is happening and how I can prevent it? Here is the code i'm using to move the camera.

Code: [Select]
Vector3 point = camera.WorldToViewportPoint(targetTransform.position);
Vector3 delta = targetTransform.position - camera.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, point.z)); //(new Vector3(0.5, 0.5, point.z));
Vector3 destination = transform.position + delta;
transform.position = Vector3.SmoothDamp(transform.position, destination, ref velocity, dampTime);

Pages: [1]