How to Fix RigidBody Stacking Issue - Unity Object Stacking Issue
Are you having issues with stacked RigidBody objects in Unity? Do they keep falling over when you stack them too high? This video will show you exactly how to fix the RigidBody stacking issue in Unity.
Reference Material: https://docs.unity3d.com/Manual/class-PhysicsManager.html
Free Game Assets: https://www.gameassetsgarden.com/
Subscribe to my YouTube channel: GameAssetsGarden
[Video Dialog]
Hi, my name is Mike, and in this video we’re going to quickly learn how to fix the RigidBody stacking issue in Unity. Just in case you’re unfamiliar with this, I’ve loaded a demo project that clearly demonstrates the problem with stacking numerous RigidBodies. Over here, I have a bunch of default unity cubes stacked fairly high, and over here, I have a smaller set of thin cubes. Now when I click play, we can instantly see the instability in each stack. Even though gravity is the only outside force being applied, both the default cubes, and the thin cubes collapse to the ground.
One thing we could do is increase the drag on all of our rigid bodies. So let’s set everything to a fairly high value of two. This will greatly improve the stability, however, it would affect the realism when the objects get knocked over in our game. As you can see, it almost appears to be moon gravity when the drag is set too high. So let’s undo our changes and move on.
The next option is to change the way we stack our objects. Here you can see that I’ve built a basic wall with the thin cubes, using a brick laying pattern. If we click play, we can see that the wall is very stable and requires no physics modifications. That’s great, but what if we specifically want to make a tower without using a brick laying pattern?
For that, a much better option is to enable Adaptive Force in the project settings. This builtin feature will apply an additional force to our objects to improve the stability of large stacks. To do that, we go to our “Edit” menu, select “Project Settings”, click on the “Physics” tab, and then check the box next to “Enable Adaptive Force”. Now we can close this window and run the game. As you can see, all three stacks are very stable, but they will still look realistic when they fall over. So when I force the cubes to fall over, you can see that the outcome is very realistic. The adaptive force feature is great, but please keep in mind, this won’t fix every scenario. If the stack is too high, it’ll still fall over. For example, if we add five more cubes to the big stack, it will collapse when we run the game.
With that being said, that wraps up today’s video. Now that you know how to work around the stacking issue in Unity, I’d really like to hear from you. Did this fix your problem, or did you find another solution? Let me know by posting it in the comment section. As always, thanks for watching and I’ll see you in the next video.
Subscribe to my YouTube channel: GameAssetsGarden
[Video Dialog]
Hi, my name is Mike, and in this video we’re going to quickly learn how to fix the RigidBody stacking issue in Unity. Just in case you’re unfamiliar with this, I’ve loaded a demo project that clearly demonstrates the problem with stacking numerous RigidBodies. Over here, I have a bunch of default unity cubes stacked fairly high, and over here, I have a smaller set of thin cubes. Now when I click play, we can instantly see the instability in each stack. Even though gravity is the only outside force being applied, both the default cubes, and the thin cubes collapse to the ground.
One thing we could do is increase the drag on all of our rigid bodies. So let’s set everything to a fairly high value of two. This will greatly improve the stability, however, it would affect the realism when the objects get knocked over in our game. As you can see, it almost appears to be moon gravity when the drag is set too high. So let’s undo our changes and move on.
The next option is to change the way we stack our objects. Here you can see that I’ve built a basic wall with the thin cubes, using a brick laying pattern. If we click play, we can see that the wall is very stable and requires no physics modifications. That’s great, but what if we specifically want to make a tower without using a brick laying pattern?
For that, a much better option is to enable Adaptive Force in the project settings. This builtin feature will apply an additional force to our objects to improve the stability of large stacks. To do that, we go to our “Edit” menu, select “Project Settings”, click on the “Physics” tab, and then check the box next to “Enable Adaptive Force”. Now we can close this window and run the game. As you can see, all three stacks are very stable, but they will still look realistic when they fall over. So when I force the cubes to fall over, you can see that the outcome is very realistic. The adaptive force feature is great, but please keep in mind, this won’t fix every scenario. If the stack is too high, it’ll still fall over. For example, if we add five more cubes to the big stack, it will collapse when we run the game.
With that being said, that wraps up today’s video. Now that you know how to work around the stacking issue in Unity, I’d really like to hear from you. Did this fix your problem, or did you find another solution? Let me know by posting it in the comment section. As always, thanks for watching and I’ll see you in the next video.
Comments
Post a Comment