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 /
  • Help Room /
avatar image
0
Question by Chandra-D-P · Jul 17, 2016 at 12:44 PM · fpssprites

FPS count is going less than 20 by increasing the number of 2D sprites

Hi, In our game we have the following game objects and the game objects count will increase with game play. 1. 4 game objects with box collider and each having a 2d sprite as a child to create lines 2. 4 game objects with sphere collider and each having a 2d sprite as a child to create a circle 3. 4 game objects with mesh collider and each having a 2d sprite as a child to create respective shapes

As i told game objects count will increase with the game play, becomes more sprites, leads to decrease in fps.

I am enabling and disabling the gameobjects based on whether gameobjects is on srceen or not but still i am facing the same problem.

Here i have attached an screenshot of the game for further details.

Please help me out in this, any help is appreciated.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Kastenessen · Jul 17, 2016 at 02:12 PM

It would be the amount of colliders and the physics processing maybe.

Do they have all rigidbodies and are they static or dynamic rigidbodies? If you are creating dynamically then make sure they are not static, as it will slow things down heaps.

Otherwise maybe look at writing the code to join verticies together to make less colliders, and reuse the same images or sprites as much as possible.

I can get some 650,000 sprites and still have 70fps+, so look into your colliders and whether or not they are static or dynamic.

Yeah other wise you will need to find ways of loading and unloading things that are off camera maybe.

Hope this helps.

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 Chandra-D-P · Jul 18, 2016 at 06:01 AM 0
Share

Thank you for the valuable response.

Here all are static rigidbodies and colliders are also static. And i am doing loading and unloading the gameobjects based camera viewport. I am also doing object pooling.

Any suggestions from your side ?

avatar image Kastenessen Chandra-D-P · Jul 18, 2016 at 06:06 AM 0
Share

Using statics will slow it down, mark everything as non static (dynamic).

That is if you are creating and destroying stuff.

Check your profiler just before its peak spikes and if it is a physics processing problem then it will show up there, you can check the call count for each script or object too, and find out what's going on like that.

Hope it helps.

avatar image Kastenessen Kastenessen · Jul 18, 2016 at 06:16 AM 0
Share

Oh, make sure no colliders or sprites are overlapping too, cause that will make the physics processing and batching go a bit nutty lol.

avatar image Chandra-D-P · Jul 18, 2016 at 06:20 AM 0
Share

Thank you,

I ll just go through your suggestions and update the same.

avatar image Chandra-D-P Chandra-D-P · Jul 18, 2016 at 01:14 PM 0
Share

Yes, collider was the problem. Now it is working great.

Thank you $$anonymous$$astenessen.

avatar image Kastenessen Chandra-D-P · Jul 18, 2016 at 01:15 PM 0
Share

You are most welcome, glad to have helped.

Please accept my answer if you like.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Running While Mid Air Problem 0 Answers

¿Cómo modifico Max forward speed en Unity 5.2.3? | How do I change Max forward speed in Unity 5.2.3? 1 Answer

What is the standard direction of a character relative to its own axis? 1 Answer

FristPerson Problem 0 Answers

What do I need to do to develop an FPS survival game? 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