Posts

Showing posts from May 3, 2018

Gamespace: Camera & Skybox

Image
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 offse

Gamespace: Player

Image
Next I decided to add functionality to the sphere so that the player can control the object in the Gamespace. Player controlling ball in Game View The sphere needed a Rigidbody in order to use gravity and not fall through the floor. The 'RollingBall' script was attached so that the player could control the ball using keyboard commands and allowed a force to be multiplied and added to the ball. Player Inspector The variable 'ForceMultiplyer' was declared as a public float so that the value could be edited outside the code. The 'forward' and 'right' variables are set to zero as a default. The if statement states that: If the 'W' key is pressed move the player forward = 1 on the Z-axis causing the player to move forward. If the 'S' key is pressed move the player forward = - 1 on the Z-axis causing the player to move backwards. If the 'D' key is pressed move the player right = 1 on the X-axis causing the player to mov

Gamespace: Landscape Progression

Image
I imported the 'Nature Pack' into my Unity Gamespace from a website named 'Kenney' which has free assets that are available to download. Nature Pack Using these assets I began creating my landscape. Landscape Scene View Landscape Game View When I was happy with my layout and design, I created a sphere that the player will control in the Gamespace. Sphere  in Scene View Sphere  in Game View I decided to add materials and a skybox to my Gamespace to fit the theme of  'the sky', giving the player the sense that the platforms they are jumping onto are objects in the sky e.g. clouds. I recoloured Kenney's assets to give my Gamespace a more original feel. Coloured world in Scene View Coloured world in Game View Bibliography & References [1] https://kenney.nl/assets/nature-pack