x


Do Spring Joints work with Empty Game Objects?

Hi, I've tried so many permutations and scoured the answers and forums and all over for a decent tutorial on spring joints and have had no luck. Hopefully if I word it this way some one could please chime in! :)

I want to create an Empty Game Object which will be parented to a bone in a character. I want this "null point" (a.k.a empty game object) to bounce around like a somewhat stiff spring based entirely on the motion of the character - no matter what makes it move (keyboard or external device etc). Btw, I am not using canned animations in the character, I am animating the character's skeleton programmatically (actually via a Kinect controller but that doesn't matter here).

Then I plan on having a bone (inside a strand of hair with a weight map associated to it) LookAt the springy Null Point. That way the strand of hair will animate nicely as secondary animation to the character. I figure I could put multiple springy null points attached to this character associated to bones and weight maps in the mesh so that I can simulate a bit of secondary animation and soft body type stuff easily.

The problem is I can't even get the most basic spring joint to work when driven by controls like the keyboard. I've tried this with spheres and cubes in test scenes to no luck no matter what settings.

Can anyone PLEASE ;) provide the simplest of demo example scenes and/or walkthrough exactly what settings and what parentings and what components go where to achieve this?

thanks!!

more ▼

asked Jul 04 '11 at 04:20 AM

psdev gravatar image

psdev
70 11 14 20

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

No demo scene, sorry, but just do this:

Arm
   Hand
      Anchor + Ribidbody with isKinematic=true

Yoyo + Rigidbody + SpringJoint with connectedRigidbody=Anchor
more ▼

answered Jul 04 '11 at 12:23 PM

Waz gravatar image

Waz
6.5k 22 33 71

WOW thanks!

Using your example here, my problem was that I had the Yoyo parented to the Arm or Hand as well when I tried it. I never thought to move the empty null (Yoyo in your case) to the root. I thought it would need to be parented to the character since it would have to move with it. I guess the rigidbody connected property takes care of that?? It just totally wasn't intuitive to me to do it your way.

I was either getting crazy motion or none at all and had tried various combinations of turning on the position and rotation constraints on either of the 2 rigidbodies. I also tried throwing a fixed joint in there and trying to connect the spring joint to the fixed joint.

Unity really needs to clean up their docs. You made it perfectly clear to me. thanks for your help! :)

Jul 05 '11 at 11:39 PM psdev

sorry about commenting in the wrong place before - I moved it here now - I try to keep this place clean, but it was a typo/user interface mistake I made... Will be more vigilant in the future with keeping the answers website clean. Thanks again for your help!

Jul 05 '11 at 11:40 PM psdev
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2090
x143
x11
x2

asked: Jul 04 '11 at 04:20 AM

Seen: 1217 times

Last Updated: Jul 05 '11 at 11:40 PM