UMG Parallax Attempt
- Oliver Stanton
- Nov 29, 2021
- 2 min read
Updated: Dec 16, 2021
After playing Crysis 2 for a bit, I decided I wanted to try and recreate the parallax effect its UI has in Unreal Engine. I had no idea how to go about this so I looked it up on Google and found this forum post stating how to do something like it. I tried it and yes the images move, but they aren't very subtle nor are they very good.

There is a noticeable problem here. The movement favours the left side of the screen, moving more when the mouse is on the left compared to the right. I honestly have no idea why this is, because I didn't make this solution and only fully understand part of it, but by changing different values I achieved this result:

I also found out why it favoured the left side of the screen. When getting the viewport size, it multiplied the X and Y by -1.0 and 0.5 for the Out Range A and Out Range B respectively. This made the Return Value be somewhere like -0.75, which makes the centre of the screen more in the bottom right than the actual centre. Changing these to -0.5 and 0.5 makes the centre be in the actual centre, and thus it works perfectly on all sides.

This in an actual application however produces some very strange results however.

It may be useful for the final screen, where a bit of camera movement combined with a warping effect on all of the components (the master Canvas Panel in the menu) would sell the effect, so it's not a bad solution. However you can clearly see that the red and green squares move in the complete opposite directions from each other, and the blue barely moves vertically at all. So there is a time and place for this solution, it just isn't for individual elements.


Comments