M
M
MishkaVNorky2019-08-28 09:08:45
C++ / C#
MishkaVNorky, 2019-08-28 09:08:45

Camera in FixedUpdate, how to ignore fps?

Hello.
I need a camera in FixedUpdate, because. then all physics works well and there is no "twitching".
The problem is that then the camera rotation speed changes depending on the fps, that is, at 60 it is slow, at 30 it is fast.

_transform.eulerAngles, rot.x, rot.y, rotateSmooth * Time.deltaTime);
_transform.eulerAngles, rot.x, rot.y, rotateSmooth * Time.fixedDeltaTime);
_transform.eulerAngles, rot.x, rot.y, rotateSmooth * Time.unscaledDeltaTime);

all these options do NOT work, obviously because FixedUpdate has a different timing.
Maybe someone solved this issue?
It seems to me that it would be possible to do something like a background fps counter and dance from it. Then it would be if the game has 30 fps, then we get one value, if 60 then another.
Because the game can change fps dynamically, for example, the load at the fps level has dropped and the camera is spinning very quickly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MishkaVNorky, 2019-08-28
@MishkaVNorky

Issue resolved.
The bottom line was that it was necessary to have a joystick (mobile) and also transfer the input manager to FixedUpdate. After that, the camera worked as it should.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question