Challenge Project
In this unity challenge I was tasked with fixing a project which was full of missing code and bugs and I had to go through it to figure out what was wrong with it. To start the plane was going in the wrong direction so I opened up the code for PlayerControllerX and changed a line of code that made the plane go backwards. Then I had to slow down the plane so I added in the line of code Times.deltatime, which reduced the speed of the plane significantly. For the next part I had to stop the pane from tilting on its own, I got stuck on this so I opened up my Project 1 file and also looked up up online. I eventually figured out I needed to add some code to the PlayerControllerX file, which sorted the problem out. Next I had to fix the camera, so aligned it in the position I thought was right, took note of the lines of axis and opened up the FollowPlayerX file and added the coordinates to the lines of code which sorted out the camera, I also had to to drag the plane file into the the FollowPlaneX section so that the camera would follow it. As a bonus I also made the propeller spin on it's own by adding the C# script to the propeller and opening up the script to look at the code. Once there I added the line of code transform.Rotate(Vector3.forward, 45); which caused the propeller to spin on it's own.
Comments
Post a Comment