Gamespace: Camera & Skybox

I wanted my camera to follow the player when in the Game View and therefore set my camera to follow my target. However, this led me to not being able to see the ball. Therefore I had to add an offset so that the ball could be seen so that the player could see where they were going.

The 'Follow Target' script was attached to the Main Camera which allows the target for the camera to follow to be set and allows values for the camera offset to be changed directly in the inspector.


Camera Inspector

The inspector for the skybox asset allowed me to set the image used as a panoramic and change the image type to 360 degrees.


Skybox Inspector


The 'FollowTarget' script allows the transform variable 'target' and the Vector3 variable 'offset' editable outside of the script as these were made public.

transform.position sets the transform position to equal the target's position (The player's position (sphere)) with the addition of an offset (if set) so that the player is next to/above/in front of the target.


Follow Target Script

Moreover, the skybox was attached to the camera.



Skybox Asset


Comments

Popular posts from this blog

Logo Design

Bootstrap Template