Bobble head help

General discussion about the R.U.B.E editor
Post Reply
msm1982
Posts: 17
Joined: Tue Aug 20, 2013 4:13 pm

Bobble head help

Post by msm1982 »

Hi,

I am struggling a bit creating a bobble head character and was hoping someone could point me in the right direction.

Basically I have a character structure composed of two bodies, a head and torso, and would like for the head to bobble/sway gently back and forth. When the body is in motion or the head is pushed it would sway further than it normally does on it's own. I've tried various joints/motor combinations but the results aren't what I was hoping, but mostly because I am still familiarizing myself with both box2d and with the RUBE editor.

Sorry, I know this should be something I could answer on my own with a little more time playing around, but if there is a quick answer someone could give it would be much appreciated.

Thanks
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Bobble head help

Post by iforce2d »

You could try using some distance joints with frequency and damping set appropriately, like in the 'web' example in the testbed. I've attached a RUBE scene with some examples. The ones at the top differ only in the location of the joint anchors, so you can see how the behavior changes. The one at the bottom also has a rope joint to stop the bodies from being pulled apart too far.
Attachments
bobblehead.rube
(12.91 KiB) Downloaded 612 times
msm1982
Posts: 17
Joined: Tue Aug 20, 2013 4:13 pm

Re: Bobble head help

Post by msm1982 »

Ah, excellent, thank you, much appreciated.
Post Reply