so default framerate movement is 60 I what to cap my game at 20 fps
If you want framerate independent code use Time.deltaTime or use FixedUpdate.
With Application.targetFramerate you can set framerate
I what to cap my player movement to 20 fps and the game runs at unlimted fps
Why so?
I think you want the animation to have a low end choppy effect? If so, just do that.
Otherwise why would you intentionally lower player responsively
can you make a tutorial
Google how to adjust framerate for animation on Unity. Currently don’t have time for an animation
I don’t understand the title you gave, but if you want to limit the frequency of specific gameobject’s Update() being called – for example if that particular Update() function is quite expensive – then you can try using C# StopWatch
private System.Diagnostics.Stopwatch _stopwatch = new();
void Start()
{
_stopwatch.Start();
}
void Update()
{
const int MaxFPS = 10;
if (_stopwatch.ElapsedMilliseconds < 1000 / MaxFPS)
return;
_stopwatch.Restart();
// Write your code here
}
You understand it’s right.