Skip to main content
Cleaning up grammar and spelling errors, changing a misleading warning, and making cross references to Unity docs.
Source Link

You can put every object (except the 2D Hud canvasHUD Canvas and the directional light) as a child of a single master empty gameobject GameObject (let´slet's say with a name "WorldPlaceholder""worldPlaceholder") and Translate it's transformTranslate its Transform by the position of the main player multiplied by -1. This should be done just oneonce in a while to conserve CPU time (you can use a counter to do that ou, you place special trigger collidersCollider each XXX meters to performeperform such a task). Something like that:

worldPlaceholder.transform.Translate (player.transform.position * -1);

I repeat: DO NOT DO THIS EVERY SINGLE FRAME! It will destroy youradvise you don't do this every frame as it could be costly in CPU time.

You can put every object (except the 2D Hud canvas and the directional light) as a child of a single master empty gameobject (let´s say with a name "WorldPlaceholder") and Translate it's transform by the position of the main player multiplied by -1. This should be done just one in a while to conserve CPU time (you can use a counter to do that ou place special trigger colliders each XX meters to performe such task). Something like that:

worldPlaceholder.transform.Translate (player.transform.position * -1);

I repeat: DO NOT DO THIS EVERY SINGLE FRAME! It will destroy your CPU.

You can put every object (except the 2D HUD Canvas and the directional light) as a child of a single master empty GameObject (let's say with a name "worldPlaceholder") and Translate its Transform by the position of the main player multiplied by -1. This should be done just once in a while to conserve CPU time (you can use a counter to do that, you place special trigger Collider each X meters to perform such a task). Something like that:

worldPlaceholder.transform.Translate (player.transform.position * -1);

I advise you don't do this every frame as it could be costly in CPU time.

Source Link

You can put every object (except the 2D Hud canvas and the directional light) as a child of a single master empty gameobject (let´s say with a name "WorldPlaceholder") and Translate it's transform by the position of the main player multiplied by -1. This should be done just one in a while to conserve CPU time (you can use a counter to do that ou place special trigger colliders each XX meters to performe such task). Something like that:

worldPlaceholder.transform.Translate (player.transform.position * -1);

I repeat: DO NOT DO THIS EVERY SINGLE FRAME! It will destroy your CPU.