#Animator layers
1 messages · Page 1 of 1 (latest)
also, I figured out a way which it'd work
I can use Additive blending
and it works almost fine
but combined with the walking animation, some jank starts to happen
lemme get a vid
i've gotten some really wacky problems from additive blending
my main idea would be to essentially create an attack animation that doesn't have the legs involved, so the blending wont mess it up
I'm almost willing to leave it like that for the time being
the problem is that the character wasn't made as a "Humanoid" from the beginning
I converted it to humanoid, but with quite a few issues
I also haven't applied the transforms in Blender for the character, and the whole character and rig gets fucked up if I do
so im probably gonna have to do that again
Ah, yes, avatar masks have two separate modes
The one you showed was for humanoid avatars
The other is just a list of every transform in the avatar, which lets you set it up for generic avatars
Since this is humanoid, I would suggest creating a new humanoid avatar. You'll need to make sure the animations are imported using the new avatar.
Then your avatar masks will work as expected.
I guess I can do that
also @viscid lichen fun fact I figured out yesterday's issue with the fucked up patterns
the reason was because of the enemy's rotation
it usually happened when you dashed very close to it
how can i import the animations using the new avatar
im exporting fbx files for the animations from blender
Just change the avatar they’re using in the import settings
You can copy it from the player model’s avatar
uhh... how?
oh wait
lemme test
also, can I just copy out the animations from the fbx?
I used to duplicate them, but I don't do that anymore
If you update the FBX, and you're using the animation sub-assets of the FBX asset, then you don't have to do anything
sorry, im confused
if you duplicate the animations out of the FBX, then you'd have to delete the old ones, duplicate them out again, and re-assign everything
thats essentially what im doing rn
the problem is if I don't copy out the animations from the fbx, I can't put Events in the animations
because they're ReadOnly
ah, you just need to do to in the import settings for the asset
you also get a nicer interface, IMO
These sub-assets are generated based on the import settings for the FBX asset.
this is something i took a hot minute to figure out
You can create many animation assets from one or more source takes from the asset
In this case, I glued four different mocap sessions into one animation, then used that to generate six animation assets
(two are mirrored with a cycle offset)
from the top
you exported an FBX
Unity sees this file and imports it as an asset.
It knows how to parse an FBX file, so it doesn't just show up as a generic file asset.
When you click on the asset in the Project window, the inspector displays an Import Settings dialog
You use this to tell Unity how to import the FBX file.
Notably, this is where you tell it which avatar to use (in the Rig section)
and in the "Animation" section, you can see all of the animations it's going to import
By default, each take will become its own animation.
each Blender action becomes a take, for example
When you hit Apply, Unity reimports the FBX asset.
This results in a number of sub-assets
In this case, it produced six animation assets and a prefab asset.
30 animations in this list, or 30 animations just lying around your Project window?
(remember, this is the "Animation" tab in the import settings for the FBX asset itself)
Okay, that looks solid
what if I want to add an event to an animation
Scroll down a bit
it just says ReadOnly
ah
what about the animator btw
I will essentially have to recreate it no?
You'll need to drag the new animation assets in
(or select them from the list)
but once you've done that, you should never have to assign them again
unless you completely change the names of your Blender actions
also, pro tip: check out the Quick Exporter blender add-on
it saves the FBX settings for you
so you just hit a button and boom
I try to automate as much as possible, since I will completely forget my export settings
(this is more vital in Unreal, which is really damn sensitive to how you export the FBX)
how can I set this to calculate in frames not in seconds
because i have no fucking clue on which pixel that things needs to be on
i mean, i might soon, thanks!
You can scrub around in the preview window. That shows the frame number and also moves the position that an event will be added at
note that the event tick actually shows up a bit before its time...
This is an annoying behavior.
is 0:00 to 1:00 relative to the animation length?
I use Animancer for all of my animations now (instead of animation controllers). It lets you exactly set the normalized time / absolute time / frame number
a lot more convenient
I believe so
idk, i dont want to download too many packages yet
oh yeah, it's a huge leap
it's entirely code-driven animation
it's also a paid package
guessed that much
i dont want to pay any money for gamedev yet
if I can do it free, ill just do it free for now
not like i have a deadline to hit
yeah ngl this is much cleaner
thank you again
I only started buying packages a fair ways into my time with gamedev
great. what do I do now @viscid lichen
it merged my shield bone together with my forearm bone
wont let me create the rig
it also just bonked all my animations
It's trying to use the shield bone as part of the humanoid avatar?
for some reason yes
You can fix that in the avatar configuration
and it merged the shield bone together with the forearm
Did you export a separate FBX that's just the model?
Or is everything coming from one FBX?
actually, the first thing I'd do is to change the name of the bones in Blender so that they can be ID'd correctly
how can I fix it
what did you name these bones?
the forearm is called LowerArmL
and the shield bone is just called Bone
doesnt explain why tf it merged them though
thats what ive been doing
What do you see in that list?
i had to change some of them manually cuz itd give errors
but there is no transform for the sword
idk how to go about it
hold on
i think i did it
The sword would not show up in here. This is just humanoid body bones.
have you successfully created the avatar from the FBX asset?
yes
do the animations preview correctly in the Import Settings dialog?
oh man this shader is broken
okay, so you should be able to update your Animator Controller
delete your old duplicated animation assets
assigning the new animation clips to each animator state?
oh shit hold on i messed smth up
yep
hang on i have two cats screaming at me
somethings real fucked up
there are some animations
but they seem to amalgamate with others
okay, so now for an important bit
you've got a player model in the scene right now
where is that coming from?
okay, good
I wonder if you are now seeing the AvatarMasks kicking in
and causing weird problems because you had it on Additive
they arent on additive
until now, you were using a Generic avatar, so those AvatarMasks did nothing
Set the weights on the body layers to zero so that we just see FullBody
see how it behaves then
well
it kinda doesnt behave
even the dashing is incapable of playing
...if i dont have all 3 of them on max weight, i cant dash?
it looks as if it was still additive
I'd drag out a new copy of the player model (just drag the entire FBX asset into the scene) and manually mess with its animator
see if it's animating correctly
whats culling mode btw
in what context?
idk how to animate it though
as in test it
Assign your player animator controller to the Animator component
then enter play mode with the object selected
you can then go to the Animator window and see the animator in-action
That affects how it updates when off-screen
You might still want the animations to run if they need to trigger events
"Cull Update Transforms" will stop it from changing the transforms, but should still trigger events
did it, same broken
it feels like the avatar masks dont even affect it
pick one of the animator states and click on its Animation Clip
make sure this takes you to where you expect (a sub-asset of the model asset)
the problem isnt with that.
the animations are perfectly fine
for some reason it tries to blend them together
If this was referencing an older animation asset, then that could cause very bizarre behavior
How do you switch between idle animations and walking animations?
by pressing movement keys
yeah
there is no problem with the blend tree either
it switches between animations as it should
What are the other two layers doing? Are they sitting in states with no animations in them?
no...
thats the main problem i believe
idk how to do that
They're going to clobber both the upper body and the lower body
yeah
Add a state with no animation clip and turn off "Write Defaults", I believe
but how can I make it not then
Write Defaults makes the animator state write a default value to every single channel that's animated by anything on the same layer, iirc
but what should be it's transition
do i just need to create an edge case for every action
like "if the player is attacking or if the player is moving or if the.... then enter this empty state?
You just want the upper and lower body layers to do nothing if there's no particular animation to play
no
I don't want the idle animation to play while I am attacking
I have a specific idle animation
and I want that to turn off during any event
Right. The UpperBody and LowerBody layers will override whatever the base layer is doing.
appareantly not
Which layer is walking handled on?
I prefer to do that there, yes.
Other things should override the walk movement
(also, if you don't allow it to move the torso, you'll get weird looking walking)
to sanity check it, remove the mask and see how the animation looks
thats right
Make a new animator controller. Put just a single state in it that plays a single clip
I'm unclear where your problem is, but we might as well make sure that is behaving
excuse me what the actual fuck
hold on
something is fucking with it still
now the upperbody animation looks perfectly fine
everything works fine except the legs
again, make a new animator controller to make sure a single animation is playing correctly
my entire rig is just fucked
i don't know what exactly your animator controller does
the problem isnt with the controller
so I'm trying to guess
have you verified that by doing what i've suggested?
play one animation clip by itself with nothing else going on.
if it was obvious we'd have solved it already
just humor me please
???
the problem is that the entire rigging system is fucked
the spine must be a child of the hips
sounds like you should reassign the transforms, then
if it'd let me do it properly....
problem is that there are some shitty arbirtrary rules
like the lowerspine should be the parent of the upperspine
yes, the chain should be hips -> spine -> chest
"did it reverse during rigging? fuck you then"
is your root bone not the hip?
no
okay, that makes things more understandable
it wouldn't be that hard to rearrange the bone hierarchy so that the hips are the root
If you don't want to, though, then you can't make this a Humanoid avatar, and you'll need to make it Generic instead. That's not going to be a huge problem if all of the animations are made for this exact model.
except the hips are 2 bones.
dude
at this point it'd literally be easier to re-model a character
re-rig it
re-animate all 15 animations
and just fuck this entire thing
because different tutorials use different methods
since Generic avatars and animations have no constraints at all
yeah...
that's why they worked fine for you before
the problem is
how can I combine those 2 animations then
all I fucking wanted
is just to have the arms move separately from the legs
I mentioned that the AvatarMask has two different sets of settings
but appareantly I need to recreate everything for that
One is for Humanoid avatars.
The other works for Generic avatars.
You just pick which transforms the mask should cover.
i can try that
This is less convenient, obviously, but it doesn't demand a Humanoid avatar.
To do this, just change your model back from Humanoid to Generic in the import settings
you may need to re-assign the avatar in the Animator
the only thing keeping my sanity alive rn is celeste music
You will then need to check the appropriate boxes in the "Transform" section
or should I just set Avatar Definition to create from this model
okay good news
the walking and attacking animations work perfectly separately
but the problem of the attacking fucking up the leg still occours
even if it doesnt walk
You need to set up the avatar masks correctly now.
that is, picking which transforms each layer is allowed to affect
you should be able to just uncheck everything, then check the two upper leg transforms to make the lower body mask
for some reason
the UpperSpine controls everything
if UpperSpine is set to affect the upperbody
the attack works perfectly
but the legs dont
and if the opposite is true
the legs work perfectly
but the attack doesnt
show me the bone hierarchy
thatd be hard
there
mind you, like this it doesnt work
the attack that is
proof
i need Upperbody both for the walk and the attack....
there is no way...
@viscid lichen the problem is that the upperbody also moves the legs
I have an idea maybe
I can remake the animation so instead of it moving the upperchest it moves the shoulders
@viscid lichen it works!
it doesnt look as good as it did
but i dont even care at this point
lemme send a vid
it doesnt look as forceful as it was before
because back then it used to move it's upper body, now it doesnt
but it starts to look natural when it does it during moving