2D Parallax Mouse Movement

Hi.

I want to create a 2D parallax mouse movement in my project. It’s like the 2nd example shown here. The movement should only works in the x-direction.

The game is an escape-the-room game in first person. You can navigate only with your mouse.

I need one to three layers: background, shadows(additional) and foreground.

I’m really new in Unity and coding. So: are there any examples to learn (easily) or has anybody a hint (or maybe a solution)?

Thanks so far

One way is to have a 3D camera for your scene and have the layers on different Z positions. Set camera X and Y based on mouse position in relation to the game screen. That is simply Input.mousePosition. You should get used to reading unity docs, such as this on the topic Unity - Scripting API: Input.mousePosition

(from the live training archive in the learn section ^ link at the top of the page :smile:)

Thanks for your hints and links. I’ll try that.:smile: