Skip to content

Instantly share code, notes, and snippets.

@v21
Created December 6, 2013 16:01
Show Gist options
  • Save v21/7827173 to your computer and use it in GitHub Desktop.
Save v21/7827173 to your computer and use it in GitHub Desktop.
Vector3 parallaxCenter = background.parallaxCenter.position;
Vector3 mainOffset = mainCamera.position - parallaxCenter;
cam1.position = parallaxCenter + Vector3.Scale(mainOffset, cam1Factor);
(Scale is component-wise multiplication)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment