I love Unity3d and I just started on a game but I’ve already hit a road block when it comes to performance. All I’m doing is a simple test with around 40 boxes and they have rigid body and box collider applied. Anyhow I noticed when I compile this is runs so sluggish at around maybe (5 frames or maybe even less). Trying to cut down the boxes to 20 we getter something far better. But I would like to use minimum 40 boxes and it seems like our polys are so simple and draws are like 60. Anyhow could it be to many physics calculations are going on at once? (I have the boxes sliding off each other and bouncing).
Anyhow I’m really new and I need help,am I missing something simple in terms of optimizing.
Ok so having been playing around with the aforementioned settings I can’t seem to stack my boxes on top of each other without them first bouncing off each other. Even when I try to leave no space in between. There has to be a way to just stack like 10 boxes on top of each other and have them stay still when I click play, but they always tend to bounce a bit.
That is where the sleep velocity comes in. As long as it’s moving faster than the sleep velocity, it will appear to bounce. Also the physic material setting controls the bounciness. If you have a stack of things, it will be exagerated. In a real game you would probably want to use a trigger and set the rigidbody to kinematic after it collides, and maybe then adjust the transform of the block by script. Just an idea.
Not a bad idea, Just played around with IsKinematic and looks like maybe one way to go is enable it (noticed they dont bounce), then enable it after a few seconds or something.
Cool thanks Eric I put that code in a script and attached it to my cubes, worked but looks like its equivalent to iskinematic in that it kills all physics and remains in sleep, I guess I just need to awake the cubes after a certain time? Or can I and should I just awaken then on collision?
Sleep() only puts objects to sleep for one frame…after that they behave as normal. (i.e., will be woken up if something collides with them, etc.) isKinematic means the object doesn’t react to physics at all and can only be moved by scripting.