- Home /
how to have a configurable joint model match a 3Dmesh animation
I was wondering how I would have my 3D animated player model be hidden on screen and a dummy configurable joint model(same 3d model just the dummy has no animations) using joint forces, motors, springs and target rotation match the hidden models current pose/animation as it were. The configurable joint model is what the player will see obviously. I know that this has been done by the guys at blurst.com when they made minotaur-china-shop. I want to know how I would do this. Thanks for your help. I'm sure this can't be to hard. So to put it simply I want each dummy joint to look for its counterpart joint on the animated model and rotate accordingly to match its animated counterpart.
Answer by taters · May 25, 2011 at 02:53 PM
Hi, There is a script on unify that will make a rigidbody try and match another object by using forces etc. May come in useful.
http://www.unifycommunity.com/wiki/index.php?title=ComplicatedRigidbodyControl
Here's my solution I came up with, it's using the MovePosition and MoveRotation functions. e.g this will make the object l_knee match l_knee_parent. You can set the speed it tries to match with the 'eulerAngleVelocity' (for rotation) and 'speed' (for position) variables:
var l_knee_parent : GameObject; var l_knee : GameObject;
private var eulerAngleVelocity : Vector3 = Vector3 (0, 100, 0); private var speed : Vector3 = Vector3 (3, 0, 0);
function FixedUpdate () { var deltaRotation : Quaternion = Quaternion.Euler(eulerAngleVelocity Time.deltaTime); r_knee.rigidbody.MovePosition(r_knee_parent.transform.position + speed Time.deltaTime); r_knee.rigidbody.MoveRotation(r_knee_parent.transform.rotation * deltaRotation); }
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Create a leaf with it's natural motion acting upon gravity? 2 Answers
ConfigurableJoint Anchors and nested RigidBodies 2 Answers
How to make a rigid obj walk. 0 Answers
fireball animation 2 Answers