> For the complete documentation index, see [llms.txt](https://kap35.gitbook.io/kap-engine-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kap35.gitbook.io/kap-engine-wiki/user-manual/component/onfixedupdate.md).

# onFixedUpdate

### Why ?

As the [onUpdate](/kap-engine-wiki/user-manual/component/onupdate.md) function, this function is made to update values of GameObject.

### When ?

The difference between onUpdate and this function, is when it is call. onFixedUpdate is call each fixedTime during the game. fixedTime is a variable set in KEngine and can be modify.

If you do not change the value of fixedTime, onFixedUpdate is called each 25ms.

You can change fixedTime by using this line of code :&#x20;

<pre class="language-cpp"><code class="lang-cpp"><strong>KapEngine::KEngine engine; //here we create a new Game
</strong><strong>
</strong><strong>KapEngine::Time::ETime newFixedTime; //here we create new Time variable
</strong>newFixedTime.setSeconds(1.f); //here we set time variable to 1 seconds

engine.setFixedTime(newFixedTime); //here we set the fixedTime to 1 second.
//this code means that all onFixedTime gonna be call each seconds.
</code></pre>

### Prototype

```cpp
//hpp
void onFixedUpdate() override;
//cpp
void KapEngine::MyGame::MyComponent::onFixedUpdate() {
    //do what you want
}
```
