0
\$\begingroup\$

I have a background that I'd like to remain in the same position relative to the camera along the y-axis, but scroll in parallax along the x-axis. The x-axis parallax part I was able to implement just fine, but keeping the background fixed such that the top and bottom of the background image are always flush with the top and bottom boundaries of the Cinemachine camera is proving to be difficult, especially since there's a lot of up-and-down movement on the screen (it's a platformer).

Any help would be much appreciated! Also, I don't have any of my own code to share for the y-axis element of this issue. I'm honestly not even sure where to begin.

\$\endgroup\$
2
  • \$\begingroup\$ I found a temporary fix, but I'm not sure if it's the best idea. I pulled the y-component of the position transform of the cinemachine camera and set that as my background's y-position. Seems to work fine, but it feels like there's probably a better way that doesn't involve such tight coupling. \$\endgroup\$
    – Mav
    Mar 11 at 4:32
  • \$\begingroup\$ Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Game Development Meta, or in Game Development Chat. Comments continuing discussion may be removed. \$\endgroup\$
    – DMGregory
    Mar 19 at 2:52

0

You must log in to answer this question.

Browse other questions tagged .