How to make so sprites in canvas layers with "Follow-Viewport" only move along the X axys?

Godot Version

4.3

Question

Im trying to recreate a pseudo 3D effect, similar to the one in Hollow Knight. I found resources from godot 3.4 where using Canvaslayers it was possible to have sprites move at different speeds in background/foreground, thus giving a sort of 3D look. (like here https://www.youtube.com/watch?v=kBJhEGyVKd8 )

The thing is all resources I found are at least 2 years old, so not in godot 4.0 +

And, in these videos, items do not move along the Y axys. In my case however they do, and it creates a very weird effect, where items that should be attached to the ground float around n stuff.
here is a clip showing the problem: https://www.reddit.com/r/Nonsensical2D/comments/1i12w9k/is_there_a_way_to_make_so_the_pseudo_3d_bushes_do/

Nevermind Ive finally found a solution.

In godot 4.3 this thing is way easier to make using the “Parallax2D” node:

  1. Give the node an ordering Z index
  2. Add sprites as children
  3. Set the scroll scale in this way:
  • X: 1.1 or above for foreground elements, 0.9 or below for background elements
  • Y: 1

this way only the X gets scaled according to the viewport.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.