Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Slayerkris · Apr 24, 2013 at 08:44 AM · lagtimescale

Lag when Timescale is 1?

Hello, i've encountered a problem where I don't know what could be causing it.

I normally code at a pretty decent computer so I never noticed it before. But , right now I'm temporarily on a laptop that is a lot worse.

When I play my game, my fps hangs around 30fps. But when I pause my game and set the Timescale to 0. It goes back up to 60-70. On this laptop and the iPad that I test on it goes from unplayable to smooth.

What could be causing this?

I use Timescale for a timer only.

Thanks,

Kris

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Slayerkris · May 02, 2013 at 01:31 PM

I managed to fix my problem. It was caused by the models I was loading in. When I selected one of the models and looked at the inspecter, I went to "Rig" and noticed that the Animation Type was set to Generic. Even though the models don't have any animation.

I changed the Animation Type to None on all of my models and the lagg was gone :D.

I'm guessing setting the TimeScale to 0 made it so that the animations are stopped(even though I had none).

Comment
Add comment · 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
avatar image
2

Answer by pudd1nG · Apr 24, 2013 at 08:51 AM

Timescale is the scale at which the time is passing. This can be used for slow motion effects.

When timeScale is 1.0 the time is passing as fast as realtime. When timeScale is 0.5 the time is passing 2x slower than realtime.

When timeScale is set to zero the game is basically paused if all your functions are frame rate independent.

Except for realtimeSinceStartup, timeScale affects all the time and delta time measuring variables of the Time class.

If you lower timeScale it is recommended to also lower Time.fixedDeltaTime by the same amount.

FixedUpdate functions will not be called when timeScale is set to zero. Which is why your game FPS goes up, physics stop processing is probably the biggest FPS boost.

Moral of the story, don't mess with the timescale unless you really need to

Comment
Add comment · Show 6 · 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
avatar image Bunny83 · Apr 24, 2013 at 09:08 AM 0
Share

Yes, i think you have something heavy in FixedUpdate or the physics system in general. $$anonymous$$aybe you have collisions every frame?

avatar image Slayerkris · Apr 24, 2013 at 09:41 AM 0
Share

Hmm I don't think so. I can play the game just fine when I put Timescale on 0. the only thing that isnt working is the timer. The game is a 3d puzzle game. with just some raycasting and gameobjects changing from color.

avatar image pudd1nG · Apr 24, 2013 at 09:50 AM 0
Share

Which is why your game still (mostly) runs while timescale is 0. Don't set timescale to 0 unless you're pausing the game. If you let me know exactly what you're using timescale 0 to achieve I can provide an alternative

avatar image Slayerkris · Apr 24, 2013 at 09:58 AM 0
Share

The only reason I put the Timescale on 0 is because it seemed to remove my fps lag. I don't $$anonymous$$d putting it on 1 but then the lagg returns. I'm just wondering. It should be something that gets disabled when I pause the game. but everything works like expected when I put it on 0. I got no collisions or physics. just ray casting and changing colors of game objects

avatar image pudd1nG · Apr 24, 2013 at 10:03 AM 0
Share

If your game does run fine with it on 0 then you can keep it on 0, however the better option would be to check through your quality settings and code (especially raycasts) to make sure everything is as optimized as it can be. Another good one for slow paced games like what you've mentioned it to adjust the timestep. A simple game shouldn't lag at all on default though. Good luck

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 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

Related Questions

A node in a childnode? 1 Answer

A* Pathfinding questions 1 Answer

Why so much GPU usage for an empty scene ? 0 Answers

Too much lag in the game 5 Answers

Unity Editor lag 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