Unity Tutorial 2
Step Into The Drivers Seat
For our second tutorial on Unity we had a challenge of making an aeroplane move forward and up and down. We were given the bug on C# but had to de-bug it to make the plane move correctly. The challenge in this was, there was no video to follow for instuctions as such, just a few hints at the end of the page.
So I made sure I had my Scripts folder in order in the right section, usually it is in Assets but because the code was already pre-done and we had to de-bug it, it was in the challenges folder we downloaded.
Once I got the C# up and running it was to get the plane moving and tilting. Tilting was the tricky part. The difficulties I kept running into was the difference between "right" and "up". When trying to make the plane tilt up you'd think the word "up" would be it, wrong, "right" is to be used instead with a minus input which makes it tilt, as you can see by the code below. Camera movement was also very important as you wanted to make the camera follow the plane while in action, so in the Hierarchy, you select the main camera and at the bottom of the side panel where you have the C# attached you can select what you want the main camera to follow, as you can see I've selected the player(plane).
Comments
Post a Comment