Unity coding for scene vs game

Hi, i’m pretty new and I am having an issue in one of the tutorials. I have some code that works on a sprite in the scene but not in the game screen. When I press play it works just fine in the scene but the game display does not do anything.

Hi Morgan,

Welcome to our community! :slight_smile:

Is the z-position of the background set to 10, the z-position of the camera to -10 and the z-position of the other game objects to 0? The sprites must be in front of the camera and within the camera viewport box.


See also:

This helped me figure it out! I somehow put the same script on the camera. This caused the camera to move with the object and appear motionless in game. Thank you.

Good job on fixing the problem! :slight_smile:

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

Privacy & Terms