Is there a way to force camera movement to a fixed frame rate (e.g. 24fps) instead of the player's system frame rate? (e.g. 30/60fps etc). I'm trying to emulate the slight stuttering of film pans. Thanks.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can set Application.targetFrameRate to target a specific FPS, but AC wouldn't be involved.
I created a new object and attached a script to it to limit frame rates. Now frame rates can be set via the UI. How would I go about creating a custom action to change this value via actionlists?


If there's only a fixed number of potential values you'd set it to, you could extent your script with different public functions for each, i.e.:
Then, attach to an empty GameObject, make that object a prefab, and use the Object: Call event Action to trigger that prefab's SetTo24 etc functions.
Alternatively, it's possible to write a custom Action to replace the script. How many values are you looking to be able to set the frame-rate to?
Just need 24fps and default (e.g. unrestricted).
This is the script I'm using, I attach it to an object and then trigger the function via Object>Call Event using actionlists.
`
public class SetFPS : MonoBehaviour
{
[ContextMenu("Set frame rate to 24")] // Exposes this in the drop-down of Object->Call Event
public void SetTo24()
{
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = 24;
}
[ContextMenu("Set frame rate to Default")] // Exposes this in the drop-down of Object->Call Event
public void SetToDefault()
{
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = -1;
}
}
`
It appears to me working... although when set to 24fps, the onscreen display shows 50fps...so who knows!
`
public class FPSDisplay : MonoBehaviour
{
private float fps;
public TextMeshProUGUI FPSCounterText;
}
`