Ship is flying, sort of!

Hey guys, here’s my code for the flying as of right now.

I’m basically using space bar to lift off, or gain altitude off the ground, w makes the ship fly forward or to the right of the screen, s will make the ship go in reverse. A will turn left, and d will turn right. The spacebar makes the ship fly up because Vector3.up makes the ship increase on the y axis (0, 1, 0). W makes the ship go forward because it is using “relative force” and “Vector3.up”, relative force is based off the object’s rotation in the coordinate systems so due to my ship being angled at -90 Z, it will go forward instead of up.

As for A, forward is (0, 0, 1), so using the left handed coordinate system positive z will go counterclockwise or turn to the left.

D is similar but it uses a negative vector, so your thumb will be facing you instead of the screen, and when you turn in the direction of your fingers, z positive(forward) goes to the right, hence the ship will turn right. Did my explanation any sense? Sorry, this has been a lot to take in but this is my cursory understanding of the whole thing. :laughing:

2 Likes

Great documentation. Keep up the great work! You are on your way to being an amazing programmer/ game designer.

1 Like

Thanks, I appreciate the support! :smile:

Privacy & Terms