Search code examples
unity-game-engineanimationinverse-kinematics

unity character attached to game object


I'm quite new to Unity and there is one thing i couldn't think of how to make it and i couldn't exact information either so here i am. (sorry, my English is not perfect)

what i want to do is attaching a character to game object. In my game, player(user) will control or steer the game object and the character attached to the game object just Looks as if it's riding or driving the game object. (to help you understand, maybe you can imagine that player control a skateboard and there is a character on it)

So far, I tried 2 ways - 1. I made character as child of the game object, and gave an animation to the character but i found out it is not looks very natural. 2. I made a ragdoll and tried to attach it to the game object by using fixed joint between the game object and the character's feet but in playing mode, only ragdoll's feet was moving with the game object.

So I wonder if there is a good way to do it. Anybody can give me an advice? I would so appreciate it. Thanks in advance.


Solution

  • Your solutions is here, and its called IK: 1https://docs.unity3d.com/Manual/InverseKinematics.html

    Invere kinematics isn't an easy topic and you will have to test it a lot(of course you could find some workarounds) but if you want the most elegant solution give it a try.