Search Unity

Switching to skeleton that's controlled by ageia?

Discussion in 'Editor & General Support' started by robertseadog, Aug 15, 2005.

  1. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    I want to make a physics test like the movie you have got with the man being hit into the crates on your main page. I just wondered how you did that, I want my character to only be affected by his rigging (his joints) so that means somehow making the joints working like rigidbodies or something.

    How do I do something like this? Im thinking of making enemies that will soar in the air when theire hit by the players projectiles- but somehow I need to switch to rigidbody simulation onRigidBodyCollision..

    I don't really want to make hinges, but I need some advice anyhow on how to make this work.
    Thanks!
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    You have to setup your character with hinges and rigid bodies. Make sure the hinges are all connected correctly.
    You don't have to attach a rigid body to every joint. 8-12 hinges should be enough.

    Then use the isKinematic flag in the rigidbody so you can animate him while he isn't hit by anything.
    When something hits the rigid body, you just turn off isKinematic for all body parts and apply the force to make him fly.
     
  3. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    Ok, but do you have to have him in seperate parts for this to work (I just don't understand what you attatch the rigidbodies to..) or do I attach the hinges to the existing joints?

    Im sorry for the extra trouble but I just don't understand quite how your hinges work yet :roll:
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Your character most likely contains one mesh and a transform hierarchy.
    The transform hiearchy is animated and is what drives the skinned mesh.

    Instead of animating the transform hierarchy of the character with animation clips, you drive it using rigid bodies.

    Start simple. Create 2 capsules and add rigid bodies to both of them, then add a hinge joint to one of them. Assign the connected body property of the hinge to the other rigidbody capsule.
    This will give you the basic idea. Play around with the values of the hinge joint.
    Change the spring and the hinge axis etc.


    For the character you create rigid bodies for all the body parts. Just by selecting them and adding the rigid body component.

    Then you start connecting them with hinges as you did in the small test.
     
  5. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    Thanks I get the simple hinge test scenario, but when It comes down to a single mesh, what to do then? I can't really pick one part of the mesh since its, well one mesh.. :D

    Sorry if I am being stupid here, but I don't see what I use to assign the rigidbodies to different parts of my single mesh?
    (by the way, can hinges be broken if the force of another object is big enough?)
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Yes. Hinges have a break force. You can modify it if you inspector is set to Full.

    Well you have skinned a character in your 3D art program right?

    Which means in your a 3D art program you have a bunch of bones.

    When importing the character into unity, those bones get converted to Transform's where the Transform's have Animations attached.
    So you don't add anything to the object with the mesh but only to the bones of your character.
     
  7. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    That cleared it all up for me..
    Thank you very much Joachim I'll give it a try right away!