Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[ad_1]

this may not be constant for various framerates – is that proper?

Time.timeScale is impartial of framerate. Unity will proceed to attempt to render on the identical framerate no matter time scale. Nevertheless, time scale can have an effect on efficiency and not directly trigger inconsistent habits affected by framerate:

Rising the time scale additionally will increase the variety of physics updates that have to be carried out per second of actual time, except you then enhance the Time.fixedDeltaTime property. Rising the fixedDeltaTime will have an effect on the accuracy of the physics and ultimately will result in unusual and undesired habits.

If in case you have any costly code which runs at common intervals, rising the time scale will make this costly code run extra usually. As a easy instance:

personal IEnumerator UpdatePath() {
    var delay = new WaitForSeconds(.1f);
    whereas (true) {
        yield return delay;
        // For the sake of instance, as an example this perform is pretty gradual:
        CalculateNewPath();
    }
}

On this instance, we calculate a brand new path each 0.1 seconds of in-game time. At 60fps and the default time scale of 1, that may imply that we calculate the trail each sixth body. Now think about we set the time scale to six. Now we’ll have to calculate the trail each sixtieth of a second in actual time, which suggests we’re now working this costly perform each body!

This instance illustrates one other problem – as an example {that a} participant’s system does not have good efficiency and might solely handle 30fps. This implies at a time scale of 1, they’d run CalculateNewPath() each 3 frames. At a time scale of 6, they would want to run CalculateNewPath() each half of a body (since WaitForSeconds() does not work like that, the perform would nonetheless solely get known as as soon as per body, now each 0.2 seconds of scaled time)! One of these problem can power you to place all your sport logic into FixedUpdate() features to make sure the code runs on the right interval even when the framerate is low.

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *