How to create a static background map and have the player walk across the map with a camera following?
The Unity 5 UFO tutorial has a nice starting point for the camera following a player.
However, I was not able to make a larger sprite background fixed to 0,0 which does not move with the camera. The background will be too large for the Main Camera view so I would like the player to have free movement for exploring different areas of the static sprite background.
Currently, the scene view is showing everything move with the main camera following player inputs. The inspector shows both x and y coordinates for the player moving, but the map is moving with the input so the player is not moving independently.
The map will be larger than a camera view so I want the map to stay in one place, while the player moves (walks) over the various sections of a sprite background to reveal each location like a road map.
Thanks for any ideas.
Answer by UNDERHILL · Nov 15, 2016 at 06:01 AM
A few possible scenarios;
1) You may have everything (the level, etc) as a child under the player object. In the desired setup you described you will want the camera as a child of the player but likely not much else. Making the camera a child of the player object will cause the camera to inherit the motion transform of the player - i.e. the camera will move with the player.
2) There may be some code which scans for objects which are the player which is adding false-positives. This may have something to do with tags on gameobjects. It's really impossible to know if this is the case - it's a possible guess.
It is really hard to know exactly what is going on in this problem without viewing the unity package itself.