I am currently making a 2D game with an orthographic camera. I have different “layers” that I am trying to manually give parallax. I know the logic behind it is simple, but what is the most code-efficient way of achieving this? I’m thinking of some parallax script that I can just attach on each layer, but I would like it to run smoothly on mobile. Anyone have any suggestions? Thanks!
Click on your ‘Parallax’ tag… read the questions asked before with it and see if that helps you…
How i generally do it though;
Player or Enviroment has a movement/speed property - I choose one to be the ‘Master’
Then i create a script that controls movement of the other object (texture offset, geometry, etc) and also control limits that i might want to impose, then i read the speed from the ‘Master’ and multiply that by a float (0.5) to get half the speed… substitute the float to change rate.
Your done
Here’s a script that will allow you to create parallax layers of transparent seamless textures in front or behind your scene. Its’s designed especially for the orthographic camera. Unity Asset Store - The Best Assets for Game Making