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 yaapelsinko · May 21, 2014 at 11:34 AM · fpsperformance4.3spikes3.5.7

Performance spikes even with almost empty scene

I'm getting tired of absence of smoothness when application is playing. I've tried yet another test to check if it just me doing lame scripts.

Create new project, add one directional light and one cube in it. Scale cube 4 times big. Then create a script (one of 'JavaScript', because what if C# is the issue?) and write there:

 #pragma strict
 
 function Update () {
     this.transform.Rotate(0, 0, 90 * Time.deltaTime);
 }

Put it on the cube. This is it, now you could:

  1. Run it in editor

  2. Build an android apk and run it on a device (I'm using Tegra3-equipped one)

  3. Build a standalone app and run it separately.

Tracking cube rotation with your eyes you will (or will not) see periodic twitching. It is not too (but still) noticeable on my i5 CPU, but very noticeable on Android. Such a simple scene, what could be wrong and make it not to run smoothly?

And in real application, when there is actually some work to doo, it became even more annoying. Small twitches but ruins all smoothness.

How could I handle it?

Comment
Add comment · Show 4
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 Klarax · May 21, 2014 at 02:47 PM 0
Share

what about if you use fixedupdate ins$$anonymous$$d, maybe its your pc performance effecting the cube

avatar image yaapelsinko · May 21, 2014 at 08:16 PM 0
Share

On my PC it's taking 0.0ms to render and up to 0.3ms for main thread, resulting in about 3800 fps if not limited. No matter if I put Unity on last two cores (of 4) and set maximum priority to it. However, PC barely will affect to Android device's performance. On PC that twitches at least not too noticeable, unlike while running on Android.

avatar image JasonBricco · May 21, 2014 at 08:18 PM 0
Share

What about Vsync? I'm not sure if this has anything to do with it, but throwing it out there. Because I've noticed that when I had Vsync off, things in my scene were jittery and a bit choppy. When I turned Vsync on, it smoothened things out.

Really not sure if that applies at all to you, though.

avatar image yaapelsinko · May 21, 2014 at 08:40 PM 0
Share

No it doesn't matters. I've played around with vsync, vsync/2, with targetFrameRate, even if I set maximum fps to 30, it doesn't feel smooth. Cube still rotates unevenly, although most of that spikes probably must have been absorbed by long sleep period between frames.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by klodha83 · May 21, 2014 at 12:41 PM

Instead of scaling cube to 4 time big, have you tried using a model created of that size itself? Scaling object is sometime overkill, specially if those aren't static.

Btw, I don't think there is any issue with C# or Javascript.

Comment
Add comment · Show 1 · 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 yaapelsinko · May 21, 2014 at 08:07 PM 0
Share

Okay, I did scale down cuve to it's normal size, adjusting camera FOV to maintain cube's visible size. It didn't changed anything.

avatar image
0

Answer by mikhail111777 · May 21, 2014 at 04:16 PM

Creating a cube from editor adds a box collider without a rigidbody. As far as I can see, you are trying to move it by modifying GameObject.transform, and you also scale the cube.

Physics on Android will randomly hiccup in any of these cases, and you have three of them at once.

Comment
Add comment · Show 1 · 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 yaapelsinko · May 21, 2014 at 08:10 PM 0
Share

I've deleted collider component from that cube. Nothing changed.

avatar image
0

Answer by jamie lowes · Jun 25, 2014 at 09:56 PM

On the Android build, try moving your finger around the screen somewhere. My test app runs perfectly if the phone thinks the player is interacting. Let go and the stutter comes back. My example scene is drawing just 10 sprites.

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

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

26 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

Related Questions

Problem with the performance when activating gameObject 0 Answers

Performance Spikes in Unity in Profiler 0 Answers

Unity UI Slowing Down Android Phone 0 Answers

Forced FPS? 1 Answer

Is variable framerate acceptable? 1 Answer


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