Use unity to easily move and turn third-person characters

Source: Internet
Author: User

Not important, because the realization of the movement of characters is animated, there is nothing to say, mainly the following to achieve the character's turn.

For example, in a plane, the player presses the W and D keys, the character will move forward to the right, if the player presses a and S key then the character will be facing the left rear direction, then the character from the right front to the left rear need to turn how many degrees?

The known data only through the keyboard keys learned vertical and horizontal, only through the two data to get the angle needed to see the code in the way to understand.

The level is limited, the method is not clever, does not like suddenly sprays.

If there is a better way, please share it in the comments section.

Use unity to easily move and turn third-person characters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.