Self-taught game Unity

unity walking updated.gif

Today in Unity I have created and coded a game on my own. My first thoughts for this game was to have a spot light get brighter and bright when I get closer to a model that I would import in. So far I have coded a character to move forwards, backwards, left and right. I have also coded the camera to follow the mouse wherever it goes. The coding part was challenging put I managed to sort it out. Also in the code I have added a few lines to make the camera rotation and the character movement to be smooth when they do what they need to do. Another thing I added was when the game loads up the cursor disappears. To get the mouse back all you do is press the escape key.

Here is a few lines of code that I have written to create this little scene;

Character movement –

unity-code-movement

Camera Controller –

unity-code-camera

The next time I work on this game I will code the spot light to make it get brighter when I get closer to my robot model.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: