- Home /
Should I set character root bone to XYZ=0 before using it in Unity?
It's about character XYZ positioning in game animations. The character is 3DS MAX Biped. Let's take for example stand, crouch, prone positions. Am I correct that I should set XYZ to 0 In 3DS MAX for all these positions and only in Unity I should set the character's position to the appropriate height?
I know that all the animations should be based on XY=0, start in the center of the area. I know that if during animation character changes his position significantly, for example jump forward, he anyways must stay in XY=0 and only in Unity its position should be changed during the jump. But what's about Z? For example if the character is standing, should its root bone which is in the Pelvis area be centered to Z=0 in 3DS MAX and then in Unity positioned at the appropriate height?
Is it something about hitzones? How do you call that positioning thing? I can't find info on it, don't know how to even search.
Answer by theANMATOR2b · Jul 24, 2017 at 11:17 PM
Am I correct that I should set XYZ to 0 In 3DS MAX for all these positions and only in Unity I should set the character's position to the appropriate height? Your question really doesn't make complete sense, but just create the biped in front viewport - that's really all you need to know. Make sure your character is facing forward in the front viewport, and confirm the scale values are all 100. Reset xform before rigging and then collapse the stack. And make sure triangle pelvis is unchecked and triangle neck is checked.
I know that if during animation character changes his position significantly, for example jump forward, he anyways must stay in XY=0 and only in Unity its position should be changed during the jump. This is incorrect. If you want to drive the position of the character by code instead of root motion the character can be animated in Max any way you want. If you want to translate the root bip - go ahead - and when you want to export the animation, select in-place mode in the motion panel and the animation will be in place in Unity so you can move your character via code. If you want to use root motion (because it is more believable and looks more natural and accurate) animate the character as you want moving the root node and do not select in-place mode. Of course the character should be moved back to 0,0,0 at the beginning of every animation cycle, but the root bone can be moved in space when the animation cycle is being created - this is called root motion.
For example if the character is standing, should its root bone which is in the Pelvis area be centered to Z=0 in 3DS MAX and then in Unity positioned at the appropriate height? No - Setting up in Unity largely depends upon if you want to use code to drive the characters movement in space or if you want to use root motion to drive the character movement in space.
Animate the character moving with the root bone in all directions you need him to move in x,y and z and export it to use root motion. Animate the character moving with the root bone in all directions you need him to move and turn on in-place mode to export without root motion.
What is triangle neck checkbox for? In terms of Unity
Unchecked triangle neck is just plain wrong. Biped (wrongly) was originally created with the clavicles parented to the neck bone, which is completely just wrong. :) This incorrect set up causes issues in Unity - and probably every other engine unless using generic rig or legacy. For humanoid set up - it is important to have a correct human hierarchy.
Triangle neck checked parents the clavicle bones CORRECTLY to the top spine bone, ins$$anonymous$$d of the neck.
A question. If a character kind of jumps to the right or makes a long side step to the right in the animation, his BIP root moves to the right. How does Unity recognize that the root coordinates changed after the animation? Will the character return back to original position or will Unity change his coordinates to the new one after the animation? what I ask is if I need to change his coordinates manually in the code after the animation. Also, does Camera follow the character if the center of animation stays the same while the character does some long jumps and moves away from the center in the animation?
Will the character return back to original position or will Unity change his coordinates to the new one after the animation? This is deter$$anonymous$$ed by you on the animation import. what I ask is if I need to change his coordinates manually in the code after the animation. No - as long as your import settings are set correctly, the animation DOES actually have root motion in the imported animation file - and you do not want to use code to drive the character - this is not needed. Also, does Camera follow the character if the center of animation stays the same while the character does some long jumps and moves away from the center in the animation? By default the camera is not parented to anything, nor is there any follow instructions on it. This is added by the developer - however you want the camera to act - that is how it will act.
:)
Thanks, but not very clear yet. Let's say "Animation 1": character jumps to the right from his initial position. In the animation itself he literally jumps 1 meter away from the center of coordinates. Animation finishes there. So the character stands 1 meter away from the center of coordinates still within the first animation file. You can't return the character back to XY=0 in the end of this animation, it will look like he teleported. Then "Animation 2": Unity should run default animation - character just stands. Where will he be standing? Will Unity update his position after first animation and run the second animation with the center of coordinates moved to the place where the character's root bone finished his first animation? What import settings do you mean to implement this?
Answer by MaiJingNan · Dec 31, 2019 at 10:08 AM
1.create a new text file and paste this code an save as name "resetbiped.ms" 2.click Maxscript >run script,choose "resetbiped.ms"
-----------copy this code------ s = animationrange.end if gamigo_tools != undefined then closeRolloutFloater gamigo_tools gamigo_tools=newrolloutfloater "reset biped root position" 160 100 740 75 rootname=$'Bip01'
rotateoffset=0
zoffset=0 xoffset=-23.8 yoffset=15.783 rollout tools "reset biped root position" width:130 height:130 ( editText rootedt "biped root name: " pos:[2,20] width:138 height:16 text:"Bip01" spinner rotoffset "offset angle" pos:[2,2] width:150 height:16 range:[2,100,10] type:#integer fieldwidth:40 button btn_1 "Convert" pos:[2,47] width:140 height:20 on btn_1 pressed do ( rootname=execute ("$'"+rootedt.text + "'") for i in 0 to (int)s do ( sliderTime=i with animate on ( biped.setTransform rootname #pos [0,0,rootname.transform.pos.z+zoffset] true in coordsys world rotate rootname (EulerAngles 0 0 rotoffset.value) --in coordsys world rootname.transform.pos=[xoffset,yoffset,zoffset] ) ) ) ) addrollout tools gamigo_tools