Home Technical Talk

[Maya & Unity] Constrained Mesh Animation Problems

SuperSparkplug
polycounter lvl 9
Offline / Send Message
SuperSparkplug polycounter lvl 9
Hi there,
This is more of a Unity problem but I will need to work with this in Maya to solve it. Basically I have a rigged character with a hat, belt pouches, and a gun guided by various parent constraints. I also have an animation where the character draws his gun from his holster and aims, which is done with keyed parent constraints. This character model and animation is for a game I'm making in Unity 3D.
Problem is that Unity does not seem to care about constraints at all. It pretends like they don't exist, even when it reads from the maya file itself. All the constrained objects just stay awkwardly in place. Now I have to find a way to animate the same thing without constraints. I was hoping I could just bake simulations to solve it, but that does not have any effect. Is there a way I can bake the actual movement of the constraints into animation keys or another way I can animate so that I don't have to re-animate the entire thing again from scratch?

Replies

  • Eric Chadwick
    Usually items like this (guns, hats, accessories, anything swappable by the player) are constrained in the game engine using attachment points. In Maya, the items would not be linked to the model in any way, except temporarily for judging the animation.

    In Unity, create an empty game object, link it to the hand bone, and move it into position where the gun's pivot would be when it is held in the hand. Then use a script to instantiate the gun at that game object's position, based on a trigger event (e.g. player presses a key).

    This way, different guns can be swapped in and out. The player can customize their character with different hats, etc.
Sign In or Register to comment.