Monday, 3 February 2014

Beginning of scripting in Unity

This week I have learned how to write simple scripts for Unity during one of my workshops.

Now I created universal controller that can have different keys assigned by having only one script. I had some problems with syntax when trying to create this, but fortunately I solved it quite easily by creating a variable of type KeyCode and then just putting this variable name in GetKey statement.

Now I also created 3 spotlights each of different colour, and each assigns value true to one of the variables in the script to recognise which colour is the spotlight. now I will create more code to make sure only one spotlight will follow a player at the time, then I will create function that will change spotlights following a player.

In the end if I will have time I will create random movement for unused spotlights...

No comments:

Post a Comment