Forum rules - please read before posting.

Managing frame rate

edited September 2024 in Technical Q&A

Hi there,
Recently, I noticed a sudden frame rate spike in my game. As a quick fix, I used the following script, attached it to a GameObject, and turned it into a prefab for each scene to control the frame rate. I'm wondering if I still need this script when using Adventure Creator, or is there a way to manage the frame rate directly within AC? Any guidance would be greatly appreciated.

using UnityEngine;

public class FrameRateCap : MonoBehaviour
{
    // Desired frame rate (e.g., 60 FPS)
    public int targetFrameRate = 60;

    void Start()
    {
        // Cap the frame rate
        Application.targetFrameRate = targetFrameRate;
    }
}

Comments

  • Use Unity's Profiler, with Deep Profile enabled, to get to the source of any framerate spikes.

    General Unity optimisation/performance tips can be found on Unity's own site / Google, but AC-related tips can be found in the Manual's "Performance and optimisation" chapter.

  • Thank you so much! I'll look into it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.