I am creating a Rube Gold berg machine but the problem starts at the beginning. I added a iso-sphere into the project then applied "rigid body" and saved the location keyframe on the timeline starting at zero. The problem occurs when I play the animation, I expected it to fall down but instead it flew off in a different direction. How do I fix this?
-
$\begingroup$ Additonally to the answers: your dominoes will not work properly because they have their origin outside of their mesh. Select them all, right-click and choose Set Origin > Origin to Geometry. $\endgroup$– Gordon BrinkmannCommented Dec 1, 2023 at 15:39
2 Answers
The objects included in the simulation need to have a scale of 1 in all axes. You will need to adjust the scale of all objects. Applying the scale is most likely what you want to do.
I think there are two more issues with your simulation. You extended the frame range, but the simulation is only set to run for 250 frame. You need to extend it. The relevant setting is found under Scene > Rigid Body World > Cache.
The last issue is the collision shapes. Preferably, you'll pick primitive shapes (Box, Sphere, Capsule, Cylinder, or Cone). For example, your ico-sphere mesh is best approximated with a sphere collision shape. The primitive collision shapes are the fastest to calculate and the most stable. Convex Hull is a bit more expensive, but can represent complex shapes relatively fine for very little work. It basically generates a collider that wraps around the shape. I don't think they will produce the results you want for the rails as you want the ball to move along a groove. The most expensive is to use the actual Mesh. It may seem to be the correct option, but it can be too heavy and can produce unstable results. Ideally, you'll use a primitive shape or combine a few of them together. That's where Compound Parent comes into the picture. It allows you to approximate the shape using multiple primitive shapes as long as they are made children of the object that has this type of collision shape. I suggest to use this for the rails. You will add two cylinders and one elongated box between them (make sure to size them to match the visual geometry and apply the scale). This obviously takes more time to set up, but will have good stability while approximating the shape very well. You may even cheat a bit with the shapes to achieve the results you want (which I assume is to make the sphere fall and move along the rails). These collision shapes should be excluded from rendering.
Update: I would like to point out why the sphere was launched to the side instead of moving downwards. I attached two screenshots below. The first shows what the user sees. The second shows what the simulation sees. The second clearly shows that the sphere is placed within the first rail which is unsolvable; the setup starts with a collision. I got the second image by clearing the scale of the selected rail. While it is possible for a simulation to proceed as normal with some objects having a scale other than one, this may introduce a hard-to-find bug down the line. I can only assume that the scale is not considered in the physics simulation unlike the position and rotation.
-
$\begingroup$ Just a quick note: although it is definitely always preferable to have the scale applied, rigid body simulation can still run correctly with unapplied scales, even if they are negative. $\endgroup$ Commented Dec 1, 2023 at 15:19
-
$\begingroup$ @GordonBrinkmann I updated my answer explaining why the issue happened in the first place. I hope this explains why I consider it a bug to have a scale other than one in a physics simulation in Blender. Please remember that there are a lot of fully functional software programs with bugs that don't affect them 99% of the time. $\endgroup$– Mr ACommented Dec 1, 2023 at 18:21
-
$\begingroup$ That makes a lot of sense, thank you for explaining that. so typically if I want to make sure how they are colliding i can just clear the scale of the original object I created? Cause as I continue to build on this file I keep running into that problem. $\endgroup$– Tyler RCommented Dec 1, 2023 at 18:30
-
$\begingroup$ @TylerR Not only you can clear the scale, as I said in my comment it is always preferable to have the scale applied. If you search through this site, an unapplied scale is the cause for so many issues here. Not applying the scale on objects which you do not want to change the size anymore gives no real benefits. And negative scales can be even more problematic. $\endgroup$ Commented Dec 1, 2023 at 22:58
-
$\begingroup$ @TylerR Clearing the scale will show you what's happening, but almost always, you want the object to behave based on how it looks. The way to achieve that is by applying the scale. Putting this differently, when you clear the scale, you make the visual shape reflect the physical shape, but when you apply the scale, you make the physical shape reflect the visual shape. $\endgroup$– Mr ACommented Dec 2, 2023 at 11:08
Apply the scale of your ramp object, otherwise it messes up the interaction between the ball and this object: