Dynamic Flower Bouquet with physics

Godot Version



My goal is to create a flower bouquet.

A rigged 3D model of a flower has been imported from Blender. It has 5 bones, Bone.001 is at the bottom of the flower’s stem, Bone.005 is at the flower’s head. All bones are connected to each other.

Each bone has a collision shape, where the collision shape near the flower’s stem are smaller than the last collision shape, which is near the flower’s head. When many flowers are put together to form a bouquet, they must realistically change their form according to their CollisionShape, such that a realistically formed bouquet is created. Or that is at least my idea how it should work.

Since a bit of jiggling is enough for my purpose to create a physical behaviour for the flowers, I have added the JiggleBones (4.0) Plugin. The problem are the CollisionShapes. I assume that I don’t know how to properly structure everything, so that

  1. The CollisionShapes collide with each other
  2. Each CollisionShape moves with the bone, to which it is attached to.

The only way I found to move the CollisionShape with the movement of the bone, is to use a BoneAttachment, put an Area3D in it and then inside the Area3D is the CollisionShape. The problem here is that this CollisionShape does not react to other CollisionShapes anymore.

I have added a couple of screenshots. The structure is still a bit messy, because I am still experimenting to figure out the solution. There is also a SkeletonIK3D Node, which I still try to use, such that I can pinpoint the bottom of the flower stem to a certain position. Here the goal is to put the SkeletonIK3D Node of several flowers near each other with Marker3D to form a bouquet.

Any idea how to make all of this work? :slightly_smiling_face:

If you need any additional information, please let me know.

Should I upload the project?

Any help is appreciated. :pray:

You can add collision to bones by creating a physical skeleton. Here’s how to do it in the docs:

I’d probably set it up so bones inside a flower don’t collide with each other, only with other flowers.
I never used jiggle bones so don’t know how to make that work.

Thank you for your comment. I have read the tutorial, but it didn’t help. Right now everything works fine, except for the collision. I am having the same issue, as described here:

I still haven’t figured it out. I tried it again, but I cannot make the collision happen. This time I used the built-in function of Godot to create the physical skeleton.

Any idea why it does not work? Or maybe I should take another approach?

Should I upload the project to Github, so you can take a look at it? Otherwise, please let me know if you have any questions regarding the problem.

Thank you!

So… I actually forgot how physical bones work. You have to call physical_bones_start_simulation() that will activate the collision, but also make them go “ragdoll”. You can do it for certain bones only. You can restrict the joint to not move at all, so the flower doesn’t actually go ragdoll, or just slightly if you give the joint a little room to move.

Also here’s a tutorial for creating active ragdolls, that’ll make the flowers bend / wobble when they collide. (With downloadable example project in the description.)
It’s for characters but the code for the active ragdoll part should be the same for any skeleton.

Thank you! With your tips, I could solve the problem.

I used physical_bones_start_simulation() before, but for some reason the collision didn’t seem to work. The trick was to use the Axis Lock option of the physical bones to restrict the joints. I only allow the joints at the top to move, so the flowers hang a bit. Two different flowers are now colliding with each other. I don’t know why Axis Lock makes them collide properly, but it works.

I still have a bit of a problem with the physics. The flowers shake / vibrate a bit when they keep colliding with each other like water drops on a hot plate. Based on what I read, it probably has something to do with the internal physics engine in Godot, which also has shown unusual behaviour in other tests I made. Right now Godot Jolt is more stable, so I will use that.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.