Day 13- A code a day keeps Covid 19 away!

I had a better start today than the last couple of days. Due to Covid 19, I had a hard time being motivated and having the ability to focus on code. This morning I felt better, probably because it was pay day. Today we had a Friday meeting with Jonathan Weinberger. I learned some well known hacks from him that I would like to share below:

  • When performing script communications, everytime (.)a period comes up in the script, If you click on the period(.), there are “tool tips” that can be accessed via the pop-up menu. It is also helpful to read the syntax. These tool tips and syntax can help write the code
  • Another good hack is to type [serialized field]into the visual studio to see the inspector pop up on the screen

I had continued working with Unity and reading the tutorial on User Input Movement. Below are code for moving right to left and then up and down.

Code to Move Left to Right:

float horizontal Input=Input.GetAxis(“horizontal”);

horizontal Input=Input.GetAxis(“horizontal”);

transform.Translate(Vector3.right*horizontal Input*_speed*Time.deltatime);

Code to Move Up and Down:

float vertical Input=Input.GetAxis(“vertical”);

Vertical Input=Input.GetAxis(“vertical’);

transform.Translate(Vector3.up*vertical Input*_speed*Time.deltaTime);

I have always been timid of technology but now I am tackling it head on!