Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 FTheCloud · Aug 04, 2011 at 02:58 PM · iphoneframeratedropdecrease

Frames Per Second Decreases Over Time

Hey guys,

I just started this new game for iOS and I made a SUPER SIMPLE scene where I have two planes and a point light. One of the planes is the player and you can move it via touch. That's the WHOLE game so far and yet the game starts off running at 60 FPS and ends up running at around 4 FPS in a matter of minutes. Even if the game is only booted up and no input is given this problem still happens. Edit: Oh and I have no scripts in the scene and it still happens. Bug???

Anyone else have this problem?

Any ideas?

Thanks

Comment
Add comment · Show 7
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 GuyTidhar · Aug 04, 2011 at 03:02 PM 1
Share

Could you post the script/s?

avatar image FTheCloud · Aug 04, 2011 at 03:08 PM 0
Share

Here ya go @guyt, here's the only script I'm using:

 var rotateSpeed : float = 1.0;
 var moveSpeed : float = 1.0;
 var projectile : Rigidbody;
 var projectileSpeed : float = 1.0;
 var reloadTime : float = 1.0;
 var BulletSpawn : Transform;
 private var nextFireTime = 0.0;
 
 function FixedUpdate() {
     var playerPlane = new Plane(Vector3.up, transform.position);
     var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
     var hitdist = 0.0;
         if (playerPlane.Raycast (ray, hitdist)) {
             var targetPoint = ray.GetPoint(hitdist);
             var targetRotation = Quaternion.LookRotation(targetPoint - transform.position);
         if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.$$anonymous$$oved || Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Stationary){
             transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, rotateSpeed * Time.deltaTime);
             transform.Translate((Vector3.forward * Time.deltaTime) * moveSpeed);
             }
         if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began && Time.time > nextFireTime) {
             transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, rotateSpeed * Time.deltaTime);
             transform.Translate((Vector3.forward * Time.deltaTime) * moveSpeed);
             nextFireTime = Time.time + reloadTime;
             var bullet : Rigidbody = Instantiate(projectile, BulletSpawn.position, Quaternion.identity);
             bullet.rigidbody.AddRelativeForce(transform.forward * projectileSpeed);
             }
         }
     }
avatar image SentreStage · Aug 04, 2011 at 03:21 PM 0
Share

What do you have this script attached to?

avatar image GuyTidhar · Aug 04, 2011 at 03:23 PM 0
Share

When are you destroying the bullets you instantiate?

avatar image FTheCloud · Aug 04, 2011 at 03:29 PM 0
Share

@guyt, I have a little perimeter set up around the player made out of box colliders. The bullets are destroyed as soon as they collide with one of them. Forgot to mention that part in the intro. $$anonymous$$y Bad

Show more comments

2 Replies

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

Answer by FTheCloud · Aug 06, 2011 at 08:34 PM

Fixed :

Downgraded to Unity 3.3 so it was 3.4 that was causing the problem.

Everything runs at 60 frames-per-second now.

Found that 3.4 is extremely unstable with framerate So I'll just stick to 3.3 for now.

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
0

Answer by roamcel · Aug 05, 2011 at 09:12 AM

I can think of three main causes for framerate drops:

1- memory leaks (which we can almost certainly exclude)
2- physics (intersecating colliders that can't stabilize - pretty rare)
3- loops

Given the simplicity of your scene, and the absence of scripts in execution, it could be a physics related issue. Maybe just check that your perimeter colliders are not intersecating eachother (since I suppose they're static and manually set-up)

Comment
Add comment · Show 2 · 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 FTheCloud · Aug 06, 2011 at 12:38 PM 0
Share

I think it's a bug in 3.4 because it was working fine in 3.3. I looked at your causes and it's none of those because I've even tried deleting everything in the scene except for a guitext with a framerate counter attached to it. The frame rate still ended up dropping to the single digits.

avatar image ricardo_arango ♦♦ · Aug 06, 2011 at 02:36 PM 1
Share

File a bug report :)

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

6 People are following this question.

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

Related Questions

Low frame rate with only one texture on iPad 4 Answers

iPhone - Can i tell Unity to run at 60hz rather than 30hz? 3 Answers

Making a Terrain a child of something dramatically reduces framrate 1 Answer

Is there a way to create applications that run on fixed frame rate of 60fps on iOS? 1 Answer

Is it possible to get above 30 FPS on an iOS device? 5 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