Unity-Time. deltTime for beginners, unity5.3.0f4 for beginners

Source: Internet
Author: User

Unity-Time. deltTime for beginners, unity5.3.0f4 for beginners

First, you need to understand the principle:

Game images (animations) are loaded by a frame of images and are continuous. That is to say, there must be a frame image on a time node. The difference is that each frame has a different time. If each frame has a short time, that is, if the number of frames per unit of time is large ), the smoother the screen. The following is a continuous representation of the image flow, and the image width indicates the time when the image exists.

 

Void Update (){

GameObject. tranform. translate (new Vector3 (0, 0, 20 ));

}

 

In the past, when the above program was run, the Update function was called once every frame, that is, every frame of objects would move 10 MB forward.

 

Next we need to understand another concept: Time. deltTime:

The official explanation of unity is:

The time in seconds it took to complete the last frame (Read Only ).

The time (read-only) of the last frame in seconds ).

Use this function to make your game frame rate independent.

Use this function to make it irrelevant to the frame rate of your game.

 

DeltTime indicates the time when the last frame is completed, that is, the last frame of the current time node.

 

Void Update (){

GameObject. tranform. translate (new Vector3 (0, 0, 10) * Time. deltTime );

}

 

Related Article

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.