Hello all,
I designed a simple dummy using differently scaled cubes as the body parts. The dummy only has a torso, a head, and four limbs (no joints!). I designed walking, left / right punching animation clips for the dummy, and now I am fitting the clips into the state machine. The problem is, the dummy can’t punch when walking, and can’t walk when punching. I went through the documentation and it suggested an “avatar mask” which can let the clip only affects a certain portion of the body, like throwing stones while walking etc. The question is, how can I achieve a similar effect to make my dummy punch while walking?
Thank you!
Richard
Try watching this. Since you have animations, skip to 9:20 in the video
Hello Dreamhammer,
Thank you for the help! But for my case, I basically built a ragdoll with animation clips controlling the transform.rotation properties of the limbs, torso, and head. I don’t have any fancy stuff like a skeleton, avatar, bones, etc. Do you know any ways to achieve a similar effect without an avatar mask?
Thanks!
– Richard
is everybody in this forum just too busy? : (
Seriously? Anybody? pls help!
There is no easy way to replicate Avatar masking when there is no rig available to reference. The only method I could think of would be to separate each body part to be controlled on it’s own layer then making a rather complex system of parameters to drive the individual body parts. I’m not even sure that such a solution would work…if it did, it would be incredibly hard to scale up and maintain as production moved forward.
Cheers,
TrickyHandz
1 Like
then
Use the first link’s function to create an avatar
Use the second one to save that avatar to disk
Then feed that avatar to an avatarMask
2 Likes
Ok, thanks! I’ll try that.
Awesome!
I’m trying to save the avatar but I don’t know what the avatar file extension is. So it saves as a file. Can you tell me what the extension for an avatar object is?
Thanks!
Nvm figured it out its .asset
So this code works for creating a new avatar
using UnityEditor;
using UnityEngine;
namespace Infrastructure.Editor
{
public class AvatarMaker
{
[MenuItem("CustomTools/MakeAvatar")]
private static void MakeAvatarMask()
{
GameObject activeGameObject = Selection.activeGameObject;
if (activeGameObject != null)
{
Avatar avatar = AvatarBuilder.BuildGenericAvatar(activeGameObject, "");
avatar.name = "InsertYourName";
Debug.Log(avatar.isHuman ? "is human" : "is generic");
AssetDatabase.CreateAsset(avatar, "Assets/NewAvatar.asset");
}
}
}
}
2 Likes