|
I'm trying to implement physics in a fashion similar to World of Goo, with multiple nodes connected in a mesh of springy constraints. I've been able to implement this in codebases other than Unity (such as Box2D) with spring constraints. Unity's spring joint looks perfect for the task, but unity won't allow multiple SpringJoint components on the same object, which makes that unworkable (as far as I know). The ConfigurableJoint component DOES allow duplicate components, but the settings for it are a pain to figure out and I can't get it to approximate the spring joint. If I could, that would solve my problem, but so far experimenting with the values hasn't yielded anything. What would be my best approach for implementing this? Is there a straightforward way to configure the configurable joints to do what I want? Is there another approach entirely I haven't considered? Thanks!
(comments are locked)
|
|
Child objects of the GameObject with the Rigidbody can each have a SpringJoint on them. You'll probably wand to model it that way anyway as the joints need to be created and removed dynamically in your game. Thanks, that appears to do the trick. However, to get it to work I needed to add two joints to the child object: a fixed joint to secure it to the parent object (which it was acting independently of) and a spring joint to connect to another. This seems wasteful: I have one more joint and one more rigidbody than I need for every link I create. Is there a way to optimize this? Thanks!
May 23 '11 at 08:16 PM
starstriker1
This method Warwick describes works for me, I am using SpringJoints on the hair and hands of a character to get secondary animation on them based on their parent's motion. In my case I am not using fixed joints. For each thing I want floppy, I:
In my case, multiple SpringJoints are on separate bones of the parent object. I wish someone had spelled out use of SpringJoints for me before (the docs are horrible) and I find them quite useful... :)
Nov 08 '11 at 11:22 PM
psdev
(comments are locked)
|
