Unity Touch Swipe Camera Rotation - Touch FPS Controller (Part 1a)

  • 7年前
This Unity C# tutorial (part 1a of 2) will show you how to create a FPS controller for mobile apps similar to Dead Trigger or ShadowGun. In the next video (Part 1) we create a touchscreen joystick to move our player around. In the next and last tutorial of this(Part 2) we will extend the functionality of this joystick to create another joystick that will control player rotation. So we can have 2 joysticks on screen instead of 1 joystick and a swipe touch pad.\r
\r
There are updates to the code, please check it out on my website: \r
\r
If youre following along with the video, you can get TouchLogic from here: \r
\r
If youre using the updated code from the website youll want to use TouchLogicV2 instead: \r
\r
Google+ Community: \r
Twitter: \r
Facebook: \r
\r
To connect your device to unity, download the unity remote app and follow these steps: \r
\r
Time Breakdown:\r
0:45 - Scene explaination and script planning\r
1:45 - Starting the script, setting up variables and our function\r
3:07 - Explaination of Euler Angles in Unity\r
4:18 - Calculating our cameras pitch and yaw rotations\r
5:58 - Working Demonstration in game\r
6:30 - Invert look option\r
7:55 - Limiting the up and down look rotation with Mathf.Clamp\r
9:05 - Demonstration of clamped rotation\r
9:25 - Using our script to rotate any game object\r
10:05 - Setting up a Touchpad area on screen to limit the area you can use to rotate the camera\r
13:13 - Outro - Describing Part 2 of our FPS controller where well make a joystick to control the player movement

推荐视频