Learn someone how to program
The basics
Laura did not have any experience coding, but she wanted to learn the basics to broaden her horizon. So I offered to learn her a thing or two about programming.
I started out by showing her the basics. I let her start with using visual studio with our unity project attached. I explained to her what variables were and how you could use them. First I showed her how they should behave and their syntaxes and gradually I let her do more things by herself. Here's an example function that we wrote together:
The subjects that I covered were:
private/public
[SerializeField]
Start, Update
Float, int, bool, string
Functions
Components, an example being Rigidbody
How to manipulate other objects with a script
For loops
+=, -=
After I covered the very basics I recommended her a tutorial series so she could progress at her own pace during the holidays.
Putting it to the test
Volume dependent scripts
There were a couple of interactions that were already made, we converted them to be volume-dependent.
We had to change the following scripts:
ColorAudioObject
RotateAudioObjectClockwise
RotateAudioObjectCounterClockwise
SizeAudioObject
InverseSizeAudioObject
TransformAudioObject
Since we were changing the scripts anyway it seemed to be a good idea to merge the clockwise and counterclockwise scripts into one rotate script, and the same for the size scripts. That left us with four scripts that needed adjustments. Our method of working was that Laura wrote the code, while I explained my thought process of how to set up the scripts to her. And when she didn't understand something I explained it to her and filled in the gaps.
ColorAudioObject
When we looked through the colorAudioObject script it appeared that the color-changing was based on 8 colors that were selected in the inspector. So it would be our task to lerp through those colors depending on the volume. The volume that we got was a value between 0 and 1. So if we multiply that by 8 then we have a volume range of 0-8, which will put our max value in the range of the color array. Of course we still had to make sure that we had a rounded value and that it was an int, so we rounded the value and cast it to an int.
SizeAudioObject
The code is quite similar to ColorAudioObject, we use the + 1 to account for the fact that we start with a base scale of 1.
TransformAudioObject
RotateAudioObject
Last updated
Was this helpful?