• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by MissingNo7 · Jun 20, 2020 at 07:57 PM · frames per second

Step button currently moves at 50fps, how do we change it to 60fps?

I noticed the Step button in the editor seems to be moving at a set rate of 50fps. I attached the following script to move a 1 unit sprite 1 unit to the right on the x axis per second:


 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class MoveTest : MonoBehaviour
 {
     public Vector3 player;
 
     // Update is called once per frame
     void Update()
     {
         transform.position += Vector3.right * Time.deltaTime;
     }
 }

Real simple. Each time I press the Step button I can see the sprite moves 0.02 units to the right. Issue is I am trying to design a game around 60fps increments and would like to use the Step button to check frame by frame what the game does. As of right now, 50 step presses moves the sprite over 1 unit. I need to change this to 60 step presses to move 1 unit.

Is there a way to change this? I thought disabling VSync and setting the Application.targetFrameRate to 60 in Start(), Awake(), or even Update() methods would work but hasn't. Awake method example:


 void Awake()
 {
     QualitySettings.vSyncCount = 0;  // VSync must be disabled
     Application.targetFrameRate = 60;
 }

Any help, or share on how to achieve this will be helpful, and appreciated. Thank you!

Comment

People who like this

0 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MissingNo7 · Jun 20, 2020 at 09:24 PM 0
Share

Thought to include a image of the step button in case it is needed.

alt text

step-button.png (1.8 kB)

1 Reply

  • Sort: 
avatar image
Best Answer

Answer by MissingNo7 · Jun 20, 2020 at 10:12 PM

The closest to a solution I currently have is to go into Edit > Project Settings > Time > Fixed Timestep, which is set to 0.02 by default, and change it to 0.01666667. As there is no way I am aware of to set it to 1/60 exactly (which has an endless decimal point, 0.016666666666666666...).

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

126 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why do my frames per second increase dramatically when I change Environmental Lighting? 0 Answers

Real time scaling with colliders 0 Answers

How to calculate an accurate frame duration? 0 Answers

Taping keys in Unity editor drops frames, why? 0 Answers

Sudden frame rate drop in 2020.3.0f1,Sudden drop in frame rate in 2020.3.0f1 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges