• 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 Jeaper · May 08, 2013 at 09:20 AM · physicsfpsgravitylow

I am getting LOW Fps, because of simple Physics. Help.

I am using very simple physics with box-coliders. I can get down to 3 FPS. My teachers can´t figure it out. I hope you can. Webb-Player Link: https://dl.dropboxusercontent.com/s/0vp0lu768unj6dk/Public.html?token_hash=AAEvzQ0goAOXYPT7AJXF7iIUt-UlKsaBo-GDS7eIfu500Q

The object that is dropped.

alt text

Here is the project if you want to take a look. https://www.dropbox.com/s/03dlm8mr1099y9l/blockubuilder.rar

You can drag things around with the cursor.

You can edit the spawning in the "Spawner" object.

I really do hope you can help! / J

printscreen.png (160.5 kB)
Comment
Add comment · Show 11
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 chelnok · May 08, 2013 at 09:45 AM 0
Share

the link makes my browser to download "Public.html". Fix the link taking "&dl=1" part away. You should also show some code ..cant really tell what might be wrong without more info.

avatar image whydoidoit · May 08, 2013 at 10:01 AM 0
Share

Do you move things around that don't have a rigidbody attached?

avatar image Jeaper · May 08, 2013 at 10:50 AM 0
Share

Walls and the floor do not have rigidbodys attatched, I dont have any code running in the scene, Just normal Unity physics.

avatar image Jeaper · May 08, 2013 at 10:54 AM 0
Share

If it helps, here is the Profiler. alt text

print2.png (148.6 kB)
avatar image Jeaper · May 08, 2013 at 11:34 AM 0
Share

$$anonymous$$issread your comment, No, the only things we move around have rigid bodys attatched. $$anonymous$$y thoughts are that the objects do not go into sleep mode, which may make the physics go crazy?

Show more comments

4 Replies

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

Answer by Jeaper · May 08, 2013 at 06:50 PM

It appears to be a problem with using the terrain as the ground. change that to a plain with a box collider and it doesn't seem to have the same frame hitch - Adamcbrz

Solved all my problems. Thank you. Now why is that though?

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 Adamcbrz · May 08, 2013 at 06:59 PM 0
Share

(assumptions) I believe in is doing collision using a mesh collider. And since terrains can be very high poly it is much more expensive to handle. Unity and most game engines will calculate physics faster with a lot of primitive colliders then one mesh/terrain collider.

avatar image
0

Answer by Graham-Dunnett · May 08, 2013 at 03:14 PM

Some thoughts... Your boxes have a box collider on them, and that has size 1x1x1. Your boxes have a mass of 1. So, you have a one metre cube that weighs 1kg. They must be made out of some super aeronautical foam material that is mostly empty space. It's not realistic.

Also, a stack of boxes face on is about the worst case scenario for a physics engine. The physics engine has to constantly adjust the positions of each box to stop them penetrating each other. For a stack of boxes, if one box is moved very slightly up to stop it penetrating a box beneath it, it'll penetrate more deeply into the box above it. The amount of work needed to simulate this is huge. (I know conceptually you "just" need to move all the boxes up a little, but that's hard to implement in a physics solver.) You say you have "very simple physics" but in reality you have extremely complicated physics, just the everyday scenario is very simple to describe.

Unfortunately, I can't think of a simple way for you to solve this problem.

Comment
Add comment · Show 3 · 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 chelnok · May 08, 2013 at 04:01 PM 1
Share

Just to point out, units in Unity are not actually like 1mass = 1kg. Okay it can be :) but not always. I had trouble to understand it until i stumbled to: http://answers.unity3d.com/questions/39818/does-unity-3-use-si-units.html

Quote from Eric5h5: "A mass of 1 can be an ant or a planet. It's all relative."

avatar image Jeaper · May 08, 2013 at 05:54 PM 0
Share

So basically, I need to get the objects to "sleep"? any simple way to do this?

avatar image Jeaper · May 08, 2013 at 06:17 PM 0
Share

If you missed the downloadlink for the project. https://www.dropbox.com/s/03dlm8mr1099y9l/blockubuilder.rar

avatar image
0

Answer by Adamcbrz · May 08, 2013 at 03:48 PM

Ok i did a test with just the information you have provided. I did increase the gravity to y: -1000 to get a decent gravity feel but I had no lag. Here is my what i put together let me know if it works for you.

[1]: /storage/temp/10844-archive.zip


archive.zip (17.3 kB)
Comment
Add comment · Show 12 · 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 Jeaper · May 08, 2013 at 05:39 PM 0
Share

Works fine with me with 70 boxes. let me se what I can do.

avatar image Jeaper · May 08, 2013 at 05:49 PM 0
Share

When I increase the gravity in the project the fps gets even worse.

avatar image Adamcbrz · May 08, 2013 at 06:12 PM 0
Share

Do you mean in your project or the one I uploaded?

Without a project to look at I don't know how else to help.

avatar image Adamcbrz · May 08, 2013 at 06:29 PM 0
Share

It appears to be a problem with using the terrain as the ground. change that to a plain with a box collider and it doesn't seem to have the same frame hitch

avatar image chelnok · May 08, 2013 at 06:34 PM 0
Share

i can keep mouse down with s$$anonymous$$dy 60fps until container is full. After that approx 30s until fps drops to 20 something, and at that point there is lots of cubes falling to ..void. Didnt do any changes, but there was scripts missing, so i just reassigned them. I suppose you use windows Adamcbrz? And thats why the project didnt open correctly with my mac?

edit: and this aint any hi-end machine. Couple years old i$$anonymous$$ac (cheapest at the time).

@Jeaper have you tried your project / build in any other machine?

Show more comments
avatar image
0

Answer by Jeaper · May 08, 2013 at 06:27 PM

Here is a link with the project (deactivated non related scripts) you can drag the boxes with your cursor. You can adjust spawning in the Spawner object. https://www.dropbox.com/s/03dlm8mr1099y9l/blockubuilder.rar

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

Multiple Cars not working 1 Answer

AI script not using gravity 1 Answer

Running into corners causes player to slowly rise 3 Answers

How to stop an rigidbody enemy from jumping when chasing the player? 1 Answer

Question about fliping a character 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