#🏃┃animation
1 messages · Page 3 of 1
There could be a number of things happening outside of this one clip so I can't really give any specific advice
Other than to try to follow the state machine's logic and see if the clip is interrupted at some point
If you're using Any State it can be difficult to stop it from taking over
When isDead becomes true, I suppose speed will still continue to have a value that would trigger Run animation
Run can only be transitioned to from Idle
Does your to Death transition have "can transition to self"?
I think you never mentioned what actually happens when the events fail to be called
Yes "can transition to self" is true
Then it's transitioning to Death again and again every frame
I suppose it gets stuck at the 0:00, only the animation and event of 0:00 gets called
Funnily enough I was talking about this exact issue right above our discussion
Yes, now I peacefully die
thanks

Next time give all the info and symptoms you can up front so the problem can be found sooner ^^
I mean I didn't even know where to look for the problem
Thanks again
hello, is the playhash method instantaneous? if not, is there a way to instantaneously play an animation regardless of it's current animation state? can't find anything online and I don't want to waste time doing something if I don't know it will work
hmmm
uh sooo how do I end a loop
is it the arrow that points toward exit?
How do I make the levelanimation go towards exit after game
@humble socket select the animation in the project tab. I the inspector there is a checkbox for looptime
I'm not sure that will do what you want it to though. You could make a second animation that's just the cut screen without the fade, then transition the fade animation into the solid animation and let the solid one loop.
Thanks that really helped 🙂
@humble socket my pleasure
You have an any state transition that is set to transition to self, so it will transition to itself every single frame while the condition is true, restarting.
Either would work.
Where are you setting it? The state, or the animator?
It is there for triggers mostly.
So the most common case is when you retrigger an animation by trigger ?
Yes. Stuff where you might want to play from the beginning even if it's already in that state
state, animator, script, everything but no fix
Ok. Start from the beginning. You want your animation to play at a different speed. All animations, or just a specific one?
ok thanks 🙂
Hello, I wanted to know if any of you know how to create the effect of the 3D coin that falls to make an animated background
Hey everyone. I have a character that has 10 different facial animations included within the FBX. When I bring that to Unity as a Generic Rig, the face animation plays correctly. As soon as I change it to Mecanim, only the jaw moves.
I tried creating an animator controller, with the base layer being an idle animation. Then I added another layer below that one and added my looping face animation with Additive and Weight:1. Still I only get the jaw moving.
What am I missing? Thanks!
I have a screenshot in my forum post: https://forum.unity.com/threads/how-to-setup-a-mecanim-character-to-play-face-animation.1328193/
can someone help me with an animation?
i can't switch from the idle to the running animation
downloaded some animation assets, and downloaded the unity chan asset, and i duplicated the animations from the animation assets and am using them on a new animator for the unity chan prefab, but now if i want to edit the animation theres no way to visualize the animation while editing it, probably because it isnt "linked" to the model? is there a way to work this out or should i straight up animate on external software instead?
well i clicked the controller property in the animator component of the prefab within the scene and somehow it made the animation editing work
You need to import the additional face bones in the importer; by default a humanoid only uses the humanoid transforms.
You'll need to provide more info.
You can drag any model you want into the preview window for the animation.
Could anyone help as to why my animation seems to do one loop then gets stuck at the beginning of the loop? https://gyazo.com/91f23ba7aadc5747a36f0738cc0f63c7
Does anyone know how to rotate an attack animation in a way that the swing hits where the player's mouse or character's overall rotation is facing
I have running animations that change the direction in which the armature is facing so only the forward running, backward running and idle animations allow the attack animation to swing at the correct direction
I've got a character with blendshapes, but playing any animation on the character resets them, whether it be via the animator or timeline. Does anyone know how to disable this?
I've tried masking but it doesn't appear to work.
I've also un-checked Write Defaults.
Do you not have the animation set to loop? Do you automatically transition to a different state? Do goblins from another dimension sneak into your computer and prevent your animator from looping? No way to tell without more info but I'd check on those first two.
Gotta be goblins, I tried to find a loop setting but maybe I missed something, ill check in the morning
It is in the inspector for the clip.
Do the rotation in LateUpdate
Holy shit that worked! Thank you very much!!!
The animator works after Update, but before LateUpdate.
Is there a way to do a mask that only affects the face?
When I only select the facial bone transforms, but click the head in the humanoid green/red thing. The whole head is locked into place.
If I unclick the head, none of the facial bones move.
Perhaps you added another armature onto the gameobject rather than just adding another clip to the animator?
I'm not familiar with the avatar system at all unfortunately
Is it possible to copy-pasting the keyframes in the timeline?
My mistake, for a moment I assumed the menu in the image was on a gameobject
Could you elaborate please? What do you mean by the importer? I usually just export the the maya rigged mesh to an FBX, then change it from Generic to Humanoid. Is there another step i need to take?
i don't know why but when i move the idle and the moving animation are mixed
can you use an animator component without an animator controller?
I just want the animator to play a certain clip
seems wastefull to create a whole animator controller
Select the head and make the layer additive?
Yes; you need to choose the option to import additional transforms in the rig.
It still takes over the neck, I had to delete the key frames from the animation everywhere but the face haha.
Thank you though
That's what the 'simple animation' component is for https://github.com/Unity-Technologies/SimpleAnimation
i have a buuunch of animations, all i want to do is automate the process of changing all the target mesh names from Body to Head. Is this possible?
Open the anim file outside of unity and regex the names?
Or use a script to do it
(Always backup first just in case)
For some reason the eyes aren't blinking
I set up this animation that makes it go from open to closed
As you can see
But the sprite never changes to the closed eyes
it just stays open, even though all the other sprite animation things are working, the stuff under the sprite changing animation is a color changer which works just fine
Hey guys my animation plays in my animator but doesnt play visually
^^ Fixed it, it had to do with the static and Contribute GI
I'm having a hard time figuring out how to add animation to the new input system script.
Hey!
I'm searching for someone who is experienced in Human animation setups & weapon animations.
I don't want animations done, I simply have questions that would be to long to describe here.
I'll even pay for the informations :))
Shortstory : I'm not sure if I set up my human rig correctly to work with first person weapon animations.
And I'm not sure if my weight painting is correct as when rotating the wrist I get odd deformations.
Generally speaking, please only hit me up (DM) if you're experienced and worked with games already that required human & weapon animations. ❤️
where should i go to make a 3D character for my game that i can also add animations, i was thinking abt blender but just wanted to see if there was a better option
plz @ me if so
you can go to Maya or Blender
this one
maya for modeling then go to zbrush if you wanna sculpt for more details
Blender is the most popular free option. There's no real reason you shouldn't use it.
blender you can make models and sculpt
^ this
k, thx 4 ur opinions 🙂
Set the curves to no interpolation?
well most likely your ground checking isnt properly set up
or you are not taking it into account in your animator
hard to debug with 0 information
sorry im not really good with animator
i never had a proper C# subject/class im sorry
the dashing works
anyways.
- I would check if your isGrounded() really works. Try printing out if you are really on the ground or not. If that's not working correctly fix it.
- It wouldve helped if you showed us your animator setup with the connections, pretty much you need to check your connection when you want to leave your jump animation, check if the bool is correctly assigned so you leave the animation once ground IS TRUE
np.
it works now ty
Hey! I have a weird artifact with my animation when imported into blender. When it moves from frame 16 to frame 0, this happens:
It seems like the feet move to a centered position at frame 0 for some reason, even though they're keyed to be at the correct position
Does anyone know whats the best way to do this?
I have around 10.000 and each of them have an animator with the same animation for each exact tile, is there a performant friendly way to animate all of those tiles?
Also im using the regular legacy unity, no URP or HDRP
Ten thousand of what?
tiles with the same animator and animation
Tiles? Sprite frame animation or skeletal animation or what?
There are many different techniques for mass optimization, but it depends on the exact case
i would like to know atleast one, my constraints are that im using 2d sprite animations frame by frame and that im using the legacy unity without URP or HDRP, what are the possible solutions?
Long story Short I'm trying to animate a UV and I can't figure out how the hell I'm supposed to do that
Isn't there supposed to be a tiling option? So I can move the UV's coordinates around a map?
There's no need to double post
Sorry
Would be better off figuring out how to actually ask in a way that someone can understand the question.
right now i have a bunch of script for movement, but it's with a capsule, i have this default player model i found on mixamo, and i was wondering how i can get actual movement animations for it and what i can do to configure animations with my movement script?
hey guys im animating in unity and im trying to fix some thing with my menu, basically when i click the button in the bottom left i want the image to change to something else to show the button is depressed, currently my menu pop ups and everything like i want but i cant get that to work
is there an on click trigger for that?
anyone have simple way of implementing simple 10< frame, effect like animations?
i feel instantiating a gameObject just to play 2 frames of animation and destroying is a bit wasteful
or am I construing 2 different things with each other
Does anyone know how to fix this? Is this a common thing? I still haven't been able to figure it out today
Hello everyone! I have a separate animation layer for a syringe item in my project. When the player equips the item, the syringe model gets parented to the right hand of the player. Any animations that are played on that animation layer don't get applied to the syringe itself, but they do still get applied to the player's arms and fingers. I believe this is happening because the syringe model isn't a part of the avatar mask that I'm using on the animation layer, but I couldn't find any way to include it in the mask when I instantiate it. Any help is greatly appreciated.
is it not possible to seperate a mesh ( like head, chest, arms, legs )
without having those issues when the mesh deforms?
I want to seperate certain things to enable/disable at runtime for performance
like when he is wearing a shirt, I could disable the upper body as its not visible
is some1 able 2 teach me blender?
i am so confused by it
im trying to make differnt people, enemys, a ship, 3 different enemy ships, and an ocean with island (which i mght just make in unity)
@twin musk Don't crosspost. Asking for someone to help you in this channel "rq", then proceed to ask someone to teach you an entire skill is completely opposite.
If you want to learn Blender, find a course to teach you. This isn't the place.
well... i dont want to go through an entire course for what I am doing, bc its a ship, and a person. theres not much to it either than what I have to code. so do u know of a good youtube tutorial, u dont have to find it, just name of vid or name of creator of vid. its fine if u dont, but @ me if you do know of 1.
Grant Abbit is a good person to look up for easy to follow, straight to the point beginner tutorials for Blender.
: )
can ayneone tell me
why it randomly stopped doing that without me changing ANYTHING?
Thanks blender..
i need help animating my charcter, how do i move the limbs?
What's the best way to have character actions animated with or without the lower part of the body, depending on if the character is using its legs (walking, running, etc.), google seems to think i can't switch avatar mask at runtime 😢 and duplicating a layer with a full body and another with a split body avatar mask in order to tweak the weight at runtime isn't really what i call clean and maintainable.
What's the best practice today for this ?
Anyone else find themselves constantly speeding up their animations?
I have recently been checking other games and my animations are almost twice as fast as when I first made them. 😅
I also wanted to try something similar
So that I could clothe my characters and disable any non-visible body parts
But there's probably a way to do it without separating the mesh
There's likely a way to create Masks for the Meshes
If you wanna try to figure it out together, we could DM each other
Oh! I didn't read that
It works now?
yeah
I even figured out how to make the mesh seamless
so you cannot see that there are seperate parts
oh?? How?
I haven't started trying this so I haven't even begun dabbling, but I'd be interested in knowing
I'm thinking about doing a tutorial on youtube for that because no one I found could answer that online
If you could, please do!
have a look at that article
I found it on the 6th google page or smth 💀
If you want the head to be seamless with the body click the head then
add the Data Transfer Modifier
You have to make 4 settings here:
1 Define the Target Mesh (Upper Body here)
2 Enable Face Corner Data
3 Enable Custom Normals
4 Set the Max Distance of influence to a low value
☠️
does it work with unity btw?
and this issue
https://i.gyazo.com/8f1efe4c087d35b77c2be09606443fd2.mp4
randomly got resolved after I restarted blender and tried it from scratch again, worked the first try.
oop
Wait, but I still see a problem with the animation
Oh oh that's the old video
yeye that was the 'issue'
https://i.gyazo.com/87f8fe489759e3aa343fb0c52d26f0fa.mp4
here it is working in Unity
Very cool!
I can successfully hide all other parts and only make example the legs visible
Did you make these animations and model?
bought the model, used animations from Mixamo
I have to much ahead of me to do everything myself haha
oh definitely haha, I was just curious
I'm actually a programmer, not an animator or anything.
but I had to figure that stuff out to continue programming
Actually, now that I have you, might you know why my animations do this?
depends.
If you're a hobbyist I can see it making sense to learn new skills
but I'm trying to deliver a game xd so time = money
definitely.
I need to put a deadline on myself
this just looks like the animation itself isnt perfectly looped
I'm somewhere in the middle, I'm trying to make a finished game sometime in the next half year
strange, because it is in blender
like the start frame isnt the same as the endframe
No matter how I do it in blender, it still exports like that
I've even re-keyed the feet animations
so are you trying to export from blender to unity
or export from unity to blender?
from blender to unity
ah
The video you see there is in the Unity inspector
yeah.
Is the animation in blender perfectly looped?
Yeah, at least visually
hmm
your animation seems to only have 15 frames in blender
and 16 in Unity
you can cut the 16th frame in Unity
even when I do that, it looks strange
it looks stranger even
I think unity doesn't repeat the first and last frame
while in blender it does
Could it have something to do with the IK?
Cause it only ever happens to the bones controlled with an IK, which doesn't get imported into Unity
Since I'm only exporting Deform bones
Still have the issue unchecked, but I'll read up on it
because I think what it does it doesnt import your IK bones as they don't have weights
but I'm not sure
and
it can have smth to do with your Animation Type you declared.
You have 'Generic'
but not sure as well
might as well read that up
well I'm also not exporting them in the FBX
Because whenever I export all the bones, including controls, it makes the model really wonky in unity
or at least the feet
get very wonky
OH! I think I may have found an issue
Nvm, didn't help
Does anyone know the best way to animate a 2d sprite with the weapon. Should I animate the 2d pixel art styled character with the weapon doing the animations together? Or should I animate the character separately and attach the weapon in unity using animation rigging? I’m trying to get it set up a little like Enter the hinge on if that helps.
I'm trying to check if an animation state in a layer mask is playing but I'm not seeing GetCurrentAnimatorStateInfo working for anything but layer 0, Any ideas?
No idea what that is but either approach is valid
This is more of a conceptual question, but i've been having a lot of trouble figuring out how I would even begin to go about it.
So imagine a 2D side-view platformer. I have a character with hand-drawn animations (so not separate joints on a pivot or with bones) that can idle, run, jump, etc. and, at any point during these actions, do a melee attack in multiple possible directions. I want to avoid issues like the leg positions switching because I attacked during a weird frame.
I was thinking I could have the upper body and legs animated separately for each state, but that has some issues beyond just keeping them synchronized. The body would be bobbing up and down during things like the running animation, and since the upper body attack animation could happen at any point it might end up visually separating from the legs because of the height changes...
How do I even approach this?
There's no simple answer there. There is no simple automated solution when it comes to flipbook animation, since like you said there are no pivots or bones. If leg position switching and the like is a big concern you can set up transitions to only happen at specific points in the animation.
There are ways to do some degree of automation- adding metadata for part pivots or the like, but it really depends a lot on what you decide you need.
First of all, thanks! It is looking like i'll need some compromise here. Second, about the conditional transitions, what would be a good way to account for the increased time to arrive at the melee attack animation? Since responsiveness is important there.
Or...maybe I could take that idea of frame-dependent animation and just make two sets of animations, of which plays when the left leg is forward, one when the right is forward...
Either way this is going to be a lot of drawing
Actually I guess that wouldn't be necessary for idle and jump, just run
I mean, you are making hand drawn animations, there's gonna be a lot of drawing.
In animator hell before i've even picked up the pen
Alright, I should start actually making this thing and worry about one piece at a time
You can create multiple transitions with different times if you need to
Funnily enough, this is actually what kinematica was designed to do
(except for 3d)
Ah, so it always plays some transition, that could work
When's some of that AI tech going to be used to automatically fill in blanks between animation states? SMH
Just wait a minute or two whenever you go between walking and running and bam, its generated an in-between frame!
Right. You can have a separate transition, and trigger the next one with the correct foot
Perfect! Thanks for the ideas, this is probably what i'll end up doing there
So, i have this animation in blender , im not worried about how it looks because its just for testing, so, ignore the weird walk and idle animations.
but when i import the character into unity and try playing it through a blend tree, it becomes weird
also these error messages
ping me if u know how to help please
i seemed to have fixed the normals problem, but not these problems yet,
and theres also some errors in the animation tab
Define 'weird?' I mean, that pretty much looks like a blend between those two animations so I'm not sure what you were hoping for?
The console errors are problems with your mesh, nothing to do with animation.
The import errors are a result of the problems listed in the animation tab; your rig doesn't fit the mecanim humanoid, so it isn't being converted without problems.
The errors actually explain the problem- your rig has extra bones with animations on them.
the back of the head is stuck in place is what i mean by weird
That aren't used by mecanim.
oh
oh, I hadn't noticed the head. That might be from missing bone weights on those vertices or you might have an extra bone that is being discarded there.
Can't tell from your pictures
if i had any missing bone weights or vertices it would have shown in blender right?
Not necessarily.
Though I'm not a blender user.
I *do *know that sometimes bone weights aren't displayed exactly the same between blender and unity when there are missing weights since it's been mentioned by other folks.
iirc they might not be completely missing weights but might not be normalized.
if i dont use the rig generation and just use the metarig, no inverse kinematics, the animations are fine, not even warnings, but animating that way will take an insanely long time
Hey! First time Game Dev. Can anyone see what I'm doing incorrectly? I triple checked to make sure that "isAttack" has the right spelling and casing
yo why wont my blend tree work
it shows this no matter what i do
i have all of the anims set up
So does anyone know if it's possible to transfer all animations and settings from one model in unity to another model?
How do i see if loop animation has restarted?
public Animator anim;
// Update is called once per frame
void Update()
{
if(anim.restarted("animStateParameter")){
//do something
}
}
hey guys i cant change the loop time bool in my animation
i grabbed these animations from mixamo btw
So, I have two running states, one with the weapon equipped, and one without. However, when I switch between them, they aren't exactly synced up and the foot placement lags/stutters for a step or two.
Is there a way to sync them up with IK? Or like, only switch from frame X5 to Frame Y5?
Your avatar isn't properly set up
If is is a mecanim humanoid then you can just reuse the animation controller. If it isn't, then you can still reuse animations if the hierarchy matches exactly but it won't be retargeted.
There isn't enough to say what is wrong. It might be a problem with your animator, or one with your input handling.
How are you switching between them now?
Just an int change
Yes.
Hi, I'm still having this problem, can anyone help me?
In Blender it looks just fine
(I only just figured it out, and it was a strange reason.)
I had a "Foot Control" which the "IK Target" of my foot was following, which in turn the leg was using as the IK target. So instead of the leg using the "Foot Control" as the target, it was using the "Ik Target" which was in turn using the "Foot Control" to copy transforms. For some reason, the leg being two modifiers removed from the destination position was enough to confuse blender when exporting the keyframes. So the animation would always start with the leg's target, or the feet, planted at their starting positions.
But whenever Blender played the animations it would look like it was acting correctly.
I've been using
Animator.Play(State[i],0,1);
to get avatar hand positions at the last frame of 20 animation Clips / States one after another without transitions.
But..... Unlike when I use transitions to go clip to clip, Play seems to reset the initial transform each time.
Since in normal play the avatar's final position changes, the saved hand positions end up being all very very wrong.
Is this a bug? How can I get around this?
How do I check in an if statement what state im in?
Usually if you want synced animations you'd use a blend tree(which syncs all animations in the blend)
You can try syncing with exit times on your transitions but that isn't guaranteed.
Ah, so moving the two blend trees into one, and giving it a different float to switch between them? I guess that makes sense. I'll give it a shot. Thanks!
no i did humanoid rig not a different one
Your character is in the 'set up avatar' pose.
So that usually means that either its avatar or the avatar for the animations are set up incorrectly.
Or that you haven't actually assigned a clip, but you said you checked that 😛
If you checked the #📖┃code-of-conduct you'd see that there is a place for that stuff.
Yeah I'm not gonna do that.
!warn 708156039115178014 No job/collab posting.
code#3761 has been warned.
Hello, I'm looking for a good tutorial to make this kind of effect: https://youtu.be/sRIgMlWUMjY?t=340
So basically how to draw a zone with minimal movements that can be oriented any direction
hi quest question with unity 2d how can i make my character idle facing the direction i was walking
can someone help me with a first person animation?
Not sure exactly which thing you're asking about- the direction pad?
It depends; you'd need to give more info about your setup, and how you're turning the character.
ik whats the problem but idk how to fix it
if i move left and stop speed will be less than 0.01 and horizontal less than 0 which makes it turn right
but even if im moving to right and stop it will be the same less than 0.01 speed and horizontal less than 0 its like i was walking left
it needs a script that knows that i was walking right and it makes me idle at right
or i was walking left and makes me idle on left
Are your different directions different animator states, or are you just flipping the object?
With the Unity Animation Rigging; it is possible to set individual bone constrains with the IK? I'm trying to use the Chain IK but results are poor because bones are rotating in a undesirable way. I'd like to be able to lock some bones completely and other bones rotate only on certain axis etc..
Is it possible?
Is there a way to get the Preview button in the Animation Window to Play the animation in place?
It moves my transform to 0,0,0 making it a massive pain in the butt to review multiple start and end positions.
First of all, configure your IDE. Second, I'm pretty sure this belongs to #archived-code-general , perhaps I'm wrong
someone knows why in the end there is an error?
You missed a curly bracket
Also, anything about code (except animation related) should be posted in #archived-code-general
(atleast I'm pretty sure it is)
oh i'm dumb sorry i thougt i was in the #💻┃code-beginner sorry
is it possible to synchronize specific animators including the disabled or hidden ones?
i have culling mode set to completely so it wont run animation off screen
the question is whether its possible to make animators work by the game overall runtime instead of them working individually
"Legacy animation clips are not supported" when trying to import an animation I just made to timeline???how tf am I suppose to animate otherwise? also I was able to import a different animation but made earlier and it works fine. Any ideas?
I'm not able to create freaking animations anymore
I can make them but every animation I make is "Legacy" any other I made before this pop up started appearing works
and they look exactly the same
alright managed to do it, instead of creating the clip and applying it to the animator component I created it in the animator component. now for some reason it has no problem accepting it.
Where would I do this? I'm likely looking in the wrong place for this, but right now I don't really know what you mean...
Or would it be here?
You might be wrong. The info they posted makes it impossible to tell whether it is their animator or their input handling that is the problem. 😛
So about 50/50 odds of it being a #🖱️┃input-system or an #🏃┃animation problem.
You'd do it through code, or by using an anystate transition with 'can transition to self.'
You can use a timeline, or try to script something.
Are you able to change the animation type in the inspector for the clip?
is sample rate on animations basically fps?
in that the higher the sample rate the smoother the animation?
No.
Unless you're using flipbook animation.
if I'm doing fading in and out for text
it will make it fade smoother tho right
No
There's no reason to mess with it for that kind of animation. It is primarily for matching up imported animations and for flipbook animations.
It doesn't affect the interpolation at all, only keyframes.
wouldn't text fading in and out be flipbook animation
actually better question
if I do sample of 1
and have 2 keyframes
one at 0 and one at 1
vs
sample of 100 with 2 keyframes
one at 0 and one at 100
there's no difference between the two?
^(specifically for fading text in and out)
Well, I'd avoid using extremes of either end.
If your game's framerate drops lower than the sample rate then you can get dropped frames. If it it too low then other things like events might night fire.
But the interpolation between those two examples should be the same for the keyframes.
... using an anystate transition with 'can transition to self.'
Let's talk about this. How would I set this up?
Thank you, I will look into this further. 🙂
How do I prevent my animator from affecting my character's bone scales? The animations don't have scale keyframes in blender, but the animator is forcing some bones to non-uniform scales like (0.9999998, 1, 1). This causes massive lags since the bones have colliders, and PhysX is apparently slow when calculating non-uniform scale colliders.
Hey, this wolf is supposed to play a walking animation when walking, but it doesnt.
It has an animator with the respective controller and avatar, and a AI attached to it
This is the walk animation
And here it is in the script
Does someone know why it doesnt play the animation?
@rugged shell you have no transitions leading to that Walk animation
Is that how to make a transition?
Yes, but you need some parameter like 'IsWalking' that tells that transition to happen
Parameters can be found next to Layers on the left.
You can create a bool "IsWalking", then in your script call animator.SetBool("IsWalking", true) instead of animator.Play
And set the IsWalking bool as a condition for the transition you made. Click on the arrow to show transition settings
The way you have it set up now, it plays the idle animation and transitions to Walk, since it has no transition conditions
Do I keep the GetComponent part of the line?
First time even seeing the animation interface
So much at once to be honest
gameObject.GetComponent<Animator>().SetBool("IsWalking", true); right?
you can, but I would cache it instead of using it multiple times. Like this:
Animator a = GetComponent<Animator>();
a.SetBool("IsWalking", true);
but your way should work too
I'm confused; why do you have it transitioning OUT of walking when walking is true?
Is this a humanoid avatar? If it is IK causing the scaling you can disable that.
If it is just some weird precision error, hard to say the best solution
It's a generic avatar, not humanoid. I noticed that when dragging the FBX to the scene, the bone scales are already messed up.
Feels like a floating point precision error... I tried a bunch of combinations in import and export settings but nothing seems to fix it
Ah, well, have you tried manually cleaning the file of scale stransforms?
Yeah I removed every scale keyframe in blender and re-exported, didn't hlep
And transforms are applied on the model?
What do you mean?
Have you tried setting all bone scales to 1 in your software?
And 'apply transforms' is usually an option of some sort in your export settings.
I tried that yes, in the t-pose I added a scale keyframe to each bone.
I might have to try more of those Blender FBX export settings. I think it has 'apply transforms' there
I mixed them up. Now it's the other way around with the arrows
I'm still running into my animation issue though. I can't get my wolf to walk
And why is the 'rotating' in the conditions?
is this right?
i have the script changing the weight amount from 0 - 1 and restarting the animation when the player is punching. is there a better way to handle melee and weapon animation. i plan to have more?
I use an int rather than a float, but otherwise that's a reasonable enough method
You need a separate transition if you want to change to walk anim when turning. All of the conditions must be true for the transition to trigger.
I mean, you probably arent rotating left and right at the same time
@hybrid tinsel Related to the bone scaling problem: I created a new Unity test project, and a new Blender file with an armature and 3 bones in it. One of the bones has a scale of (1, 0.9999999, 1) when brought to Unity, so the problem wasn't with my export/import settings or project I guess. But how come I can't find anyone else having this problem It's breaking my game and I'm sad
DUDE I might've found a workaround: Adding 'Limit scale' bone constraints to each bone in blender
Ok apparently that didn't work with my own armature, but I'm trying Unity's own Scale constraint component now, seems to work.
you mean the wrap mode? that's about the only thing I can change it seems like
I'm using unity 2021.1.9f1 with HDRP 11
I'm pretty confused right now. One of the objects I added in unity came with an origin point that was out in the middle of nowhere so I added a parent object and animated that which looks right, but it automatically added the same animation to the child object so it looks crazy in the same way.
Anyone know what's goin on here?
A better option would be an animation trigger from "Any State" that could be called by script. Think more along the lines of IsPunchingR trigger it from a press key down and every time the person presses say the "M" key it hits right.
Yah I'm using this. Although I'm going to change newAnimState from string to an enum.
public void ChangeAnimState(string newAnimState) {
if (currentAnimState == newAnimState) return;
animator.Play(newAnimState);
currentAnimState = newAnimState;
}
go into debug mode on the inspector and there should be a checkbox for whether the clip is legacy or not
Is the object you are animated set to have a legacy rig? That's the only time I've seen unity automatically creating legacy clips.
Your screenshots are confusing. It looks like you have separate animations on the parent and the child objects; I notice that both have an animator component)though one is disabled) and one has an animation component too?
Like, all sorts of crazy shit is going on there.
yeah nothing about legacy seems to be in the inspector
yah it's super crazy I can try to explain in a minute
Do you guys think this could be a good "first thing that I'll animate" thing?
I made it myself
the idea is that she's a girl that can clone herself using that backpack
but I am thinking of just removing the backpack
It seems reasonable!
Did you go into debug mode like I said?
oh my bad, I didn't go into that, I misread what you said
okay hi, I'm here.
I'm really confused to
and I'm kindof like should I just start over from the beginning
just remove everything and start from scratch
That seems like a good idea.
Don't forget to delete the unused clips/controllers so they don't interfere with the new ones.
pinball kitty.... it's so messed up
I deleted everything
or at least I thought I did
and it's still doing some crazy shit
my setup stuff
only one animation I think it's only on the gameobject thing
keep in mind I deleted every animation in my project and added one that doesn't look anything like this
What the fuck is this?
is it not supposed to be like that...
NO.
herm
The two components are mutually exclusive.
Having both on one game object will break.
I thought you needed both for it to work lol
so I probably need animator cause it lets me do multiple animations?
'Animation' is a legacy script that is only there so old projects don't break.
It can still be useful but Unity doesn't recommend it.
Do you have any idea where this animation it’s doing now is coming from cause I cannot find out why it’s doin that
You have a million scripts and components on there, so who knows?
ohhhhhhhh
something strange is afoot
thanks, I'll try to get it sorted on my own
Hello, haven't been on in a bit, but if you got a modle rigged in blender for animation how hard is it to just drop in unity? For animation, a cartoon?
is there a certain process anyone here with experience recommends for rigging one's own animations and what you recommend a beginner to do first? i just wanna make basic but custom movement animatoins
Depends on how you rigged it. For basic bone animations without modifiers you can generally just drop it right in.
Is the Unity Animation system still referred to as Mecanim? Or is that considered a legacy term now? Figuring out some resume wording right now.
Hello, can someone help me with the rigging of this? the red bone will rotate the whole model but the green, orange, pink and purple do nothing
So ehm.... Blackthornprod has a video about making an animation, and in his video there is a sample button that changes the speed of the animation. How can I do that?
Don't use samples for speed control. You can set the speed in the animator.
Mecanim is the current animation system; though most people use it to refer to the humanoid rig, it also includes the animator state machine.
Are the weights correct?
Thank you.
how do i get started with making player movement animations? im a pure beginner with animations in general
Well, first you should define what kind of movement system you are using; these are generally divided into root motion and non root motion. Keeping that in mind, it is otherwise mostly normal animation techniques, such as you can find hundreds of tutorials on.
First you need a full body motion capture suit
I’ve used the auto weight so I have no idea
So 'probably not' because autoweights are not good for this sort of thing.
You'll want to apply your own weights.
hmm ill have a look
Is it possible to make animations at runtime? (using gltFAST i can import .gltf models with animations) especially transitions?
I have made a pool of objects for enemies and activated the objects one by one in the scene but the animation is not running and got this error. The animator worked fine when there was just one object of the enemy but there is a pool of 20 objects now and animations are not playing. This is a 2D game.
Hello, I've rigged up this model but when i drag it into my scene the bones dont show up. Can someone help?
Is there a way to create a base animator controller that has no real animations so that all other objects can just use it
Yep, make an AC and set it up with the transition stand states. Then use an AC Override component on your object and assign the base AC and override the states with its animations.
Transition stand states ?
I added empty states, but then the ovveride wouldn't let me replace them with actual animations
Mobile auto correct, but yes, those states.
They don't show up in the override like I said
I haven't used it in a while. You might have to create default animations for the base AC so there's a fall back if you don't override it (since it's optional to only override some animations)
Yes probably, sad that there isn't anything better, something that would make the parameters accessible through code instead of string interface
A man can dream, still thanks
I was gonna play around and see if it was better to use root motion with the player moving without having to add any force or not use root motion and just have a standstill animation that I make move through script by like adding force, I don’t know what’s the best method of creating the root/non-root movements so I wanted to know what people with experience use
how can i make it so the animation only starts playing once the scene is fully loaded, because i have an animation that plays once you enter a scene but the beginning is cutoff sometimes because the scene was still loading but the animation was already playing ?
Anyone knows how to stop an animation being played and play it again ( Like reset the anim )? im using bools to control the anim transitions .
Hey.. sorry if this is not the place to ask this .. but how do I turn this type of image into an animation?
Yes, though it isn't simple.
You need to add a Sprite Skin component probably.
Yes; it has multiple ways to do it, in fact.
You can set a different start state and only trigger your intro animation when a condition is met.
Found out about Animation.CrossFade(), tested it and it looks like it would work well enough for my purpose, just have to make sure the .glb files come with animations
Else it would probably throw me an error
But what would that condition be
It used to be a lot easier(there used to be a built-in method that was called when the scene was loaded) but they removed that because they hate us.
Uff
But thank you
They decided that forcing you to do the whole 'subscribe to event' thing was somehow more elegant than just having a single method.
Wait so void start comes after the scene loaded ? From what i read here
No. It MIGHT come after scene loaded but it might not.
Oh okay
Things start as THEY Are loaded.
So i have to use void onsceneloaded
You need both.
You need to add the delegate in order to be notified when the scene has actually loaded
i read on many post on forum saying it doesnt, but they are quite old, will do more research before doing anything, thanks:D
One of the main features of the animation system is the built in humanoid IK, and the Animation Rigging package is a newer, more general tool that doesn't require a humanoid model.
Hey, does anyone know how i can reorder the limbs on my sprite? I want the main body to the the top layer
I could be wrong but I think that's something you do before importing
In the sprite editor, you set the sorting order per bone.
Max_R's sprite is on a single layer so they can't do that.
would my rig still work if that's the case?
only IK no other constrain
What do you mean?
Can you be more specific? Mecanim requires a specific rig to work, and the Animation Rigging package has you build the constraints in unity. If you are using Maya you can import a small number of constraints, but otherwise you have to add and configure IK and constraints in Unity. So IK you set up in, say, Blender would need to be set up again in Unity.
i did this in blender but i have no clue how to do it in unity
it's an emissionmap with keyframed streangth
Hi y'all. I am remaking space invaders in 3D. I made 2 objects for one of my space invader guys and wanted to animate these. However I have just 2 prefabs now. Does anyone know how I can make an animation that rotate between these two prefabs?
The best way is probably to make an animated shader, but you can also animate material properties directly via script or animator.
does anyone know if its possible to trigger an animation from 2 diffrent rigs using one animation controller? i have one rig for a gun and the other for the viewmodel arms and when i try to play an animation from both using one trigger it only plays one of them
I am not sure why, but my sprite isnt changing and in the animation it should (Not sure where the right place is)
So I'm trying to make the player move when doing attack animations. Would I have to code in the player moving forward with the animation, or is there an alternative to this method?
I tried moving the position in the animation but that's just a temporary thing unfortunately and does not actually move the player.
anyone know of a concrete asset with preset animation rigging
I've been trying to rig a humanoid for the last couple days and it's driving me insane
guys how to animate first person hands with third person? in short, I need the first-person arms to be animated in the third-person as well, because I'm making a splitscreen game and i need to see animations of the first player from the second player and vice versa
idk
But unity made a multiplayer sample project with full models and animations so maybe check that out
In Unity or in a modeling program?
unity
Animation Rigging package has examples you can download from the package manager
yeah, I've been trying that for the last couple days
the bones never quite work as I intend
Dunno what to say to that other than that I hope you're not trying to make a whole rig within Unity
The package's tools are better suited for controlling parts of an already rigged character
its already rigged
Hi, I have a question about animations:
My character has a landing and a take-off animation, which are basically identical, just reversed.
Usually I would apply them in the "normal" way: When falling down, raycast downwards. When the ground gets close, trigger landing animation.
When leaving the ground, trigger take off animation (landing animation reversed).
Problem with this: The falling speed of the character varies. So if the character is coming in hot, the landing animation might play too slowly.
My potential solution:
Instead of triggering animations, I measure the distance from the character to the ground and set the animation frame each update accordingly. For example (on a 30 frame animation):
=1m above ground: Frame 30
0m above ground: Frame 1
0-1m above ground: Frame 1-30
Is this a valid way to animate or are there any pitfalls I'm missing? Is it a bad idea performance wise?
Also I feel like re-inventing IK a bit...
It's generally difficult to create a system that predicts player character movement, so usually it's enough to settle for just having a quick landing animation upon ground impact
There's no right or wrong way to go about it though, but it can be tricky to control animations directly from scripts, especially considering that you can't set animation frames, only clip time/normalized time, and the system can get messy if you skip the animator state machine that way
I understand what you mean with it becoming messy, especially with other animation layers using the built-in state machine on top.
The quick landing animation is not an option unfortunately as my character is bouncy and takes off the moment it hits the ground.
Maybe I will just have a take-off animation and skip the landing animation completely, I'll give it a try. Thanks for your input!
Helps a lot to have a two-part mid-air animation, with states for going up and going down you transition between when upward speed turns negative
This is a really good idea. I'll have a play about, thanks!
one of my first time rigging anything, so don't judge me. - anyways i am rigging a simple rope, and i did all the bones and stuff, but it doesnt do anything when i put the rigged sprite in the scene, it just stayes like a sprite without bones
What is it meant to "do"?
just be a rope hanging about
that the player can interact with
So, physics?
You'll need rigidbodies, colliders and joints on all the bones for that
https://docs.unity3d.com/Manual/Joints.html
No i mean the problem is that the bones do not get imported into the scene
Bones appear when you add a sprite skin component and hit the "create bones" button
Triggers are 'used up' by the first transition to get it.
You need to make sure that you have weights on the skin, and also in the scene view you need to add the sprite skin component as Spazi said.
hello guys how can i solve this bug
'player' AnimationEvent has no function name specified!
When you create an animation event, makes sense that you need to specify a function to call
i fixed it by reanimation it
how do I fix this issue? the TP_Dash trigger doesnt work properly while TP_Forward is true, it seemingly just plays a single frame of the animation
Don't use an any state condition with 'can transition to self' with a bool condition or it will keep transitioning to itself and playing the first frame.
everything has can transition to self unchecked
And is dash immediately transitioning to idle, which is THEN transitioning right back to dash?
What is the most performant way to play a one shot animation right now? As we know animators are always dirtied on the background unless they're disabled, and Animation component is legacy. I tried using Playables, but it had the same issue after playing one animation, it gets stuck in an "always playing" state.
I have an issue where my animation transitions into a state it doesn't fulfill the trigger for
{
if (animator != null)
{
if (enemy.transform.position.y >= 2)
{
animator.SetTrigger("JumpTrigger");
}
}
}
It goes from running to jumping without the transform.y being 2 or higher
Idk what more info you'd need to help, I just started with animation this evening
It like, does the running animation for a second, then it transfers to jumping, then to running
And so on
I figured out most of it, I had forgotten to add the triggers as conditions between jumping and running
But it still does the jumping animation when I spawn the enemy even though they spawn on the ground
Do they spawn with the trigger set to true?
Oh I see what you mean
I didn't understand what it meant for the trigger to be set to true at first sorry
Turning it to false made it work, thank you
Can someone help me? I want to use an animation pack from the asset store but I can't use it on my character at all
gives a sequence of errors
Were you planning on telling us what those errors are or should we figure that out you you too?
If you're worried about CPU cost of animators, I suppose running them on the GPU using something like this could be an effective solution
https://youtu.be/KUuuXowdYyM
That isn't an option for me since my animations are sprite based.
i downloaded some running animations from mixamo, ive set the rig of the animations as humanoid and they work, i can see my characters playing them. But theres something happening with their feet, its glitching a bit. Does anyone know why?
(ops ended up showing medium run here but happens the same thing with it)
I have an walking animation, but I want to change and constraint the position of the arm. For example, holding a flashlight.
I am trying to do it with Animation Rigging. Is that the right way?
i think you need to look into animation layers
read this through
animation events are properly setup. still got this error
anyone know why once i add an animation to a humanoid model, whenever i go into play more they switch to a strange curled pose rather than t-pose? and how to prevent this?
Will do, Thanks! But managed to solve it with Animation Rigging. First time using actually but looks pretty good. Used a Rig with Two Bone IK Constraint
Hello. I reimport my char, just in maya chagen UV and after import in new char old animation stop work. Can somebody tell me please what happen and how to fix this?
First anim broken anim second char without animation
does this somehow make the medium run faster or something? I have fast run set to speed 1. But is this making the animations more smooth somehow?
Hi all,
My game has had a big issue where, suddenly, project wide, characters are glitching into getting stuck various non-T-poses in the editor (not in play mode) and having various big and small animation issues. It affects every character, but how it does so is random. We have no idea what is going on and something is overwriting the position of character rigs constantly.
One my my team members and I are currently trying to dissect the issue in a Unity Forum post to figure things out. I've explained the issue there in far better detail than I have space for on Discord. If anyone wants to help, feel free to check over this thread.
https://forum.unity.com/threads/models-suddenly-stuck-in-poses-in-editor-and-animations-messed-up-across-project.1334213/
hey I tired to import my animation sfrom blender into unity and when I did, it only loaded one of my animations, my idle animation, and on top of that, it called it "Scene" instead of idle
I'm following a tutorial by sebastian Lauge and Brackeys
is anyone here
If you just have a oneshot sprite animation with no interactivity, can do it in a shader.
It won't batch with regular sprites but you can use the same flipbook shader for all animated objects using it so those will all batch.
Yes, but you haven't really asked much we can help with.
All animations in a blend are synced.
Pretty wild. I am guessing these aren't using mecanim humanoids?
Doesn't matter if they're mechanim or not
Was just trying to narrow down possibilities.
Hi guys! Anyone has info on some free humanodid movement animation pack containing directional and back dodge roll? Im trying to animate dodge roll with just forward roll animation and setting transform.forward to the move direction but it just looks like this https://streamable.com/cy2ds4
i cant get it to work :/
Yeah, narrowing it down has been really hard. So far we've been able to tie it to the preview function as a trigger but we're still really lost.
Have you tried taking the roll you have and adjusting it? The actual pose will be pretty much the same, so you should be able to just edit the root motion and rotation curves for whatever direction you wanted? Or even remove the root motion for that animation and just control the rolling movement through code, which would let you roll in all sorts of ways.
actually im not using root motion at all, its all through code
https://streamable.com/1au5oc this is how it looks with no animation, it works just fine i think. So only issue is that i cant adjust animation properly
when using dodge roll movement and mouse looking is disabled btw
i added avatar for animator and now he clips into the ground XD
cant mixamo animations work with humanoid rig?
I have a character with about 25 different animations and this leads to super huge bundle for it even though I only use say 10 of them in any given scene and others are scene specific. Is there a way to split these into their own bundles so I can have a scene-specific bundle setup that only has the animations required for it?
How do i animate objects which have parent constraint component
hi, i have an animated character and i need to attach arms to weapons, but weapons only appear in game mode (because they spawn via prefab). How can I attach a character's arms to weapons?
How would I get animations to play one after another? I don't want them to all play at the same time. I have a list of gameobjects each with animations. I want them to play 1 animation each.
private void BattleStateEnemyTurn(){
Debug.Log("EnemyTurn!");
//Go through every enemy checking if enemy has attacked, if not, attack!
StartCoroutine(PlayAttackAnimation());
currentState = BattleState.playerTurn;
}
IEnumerator PlayAttackAnimation(){
for(int i = 0; i < enemiesSpawned.Count; i++ ){
//int attackNum = Random.Range(0, enemy.numberOfAttackAnimations); //gather a random attack number
enemiesSpawned[i].enemyAttack.SetActive(true);
AnimationFinished AnimationFinishedSript = enemiesSpawned[i].enemyAttack.gameObject.GetComponent<AnimationFinished>();
animator = enemiesSpawned[i].enemyAttack.GetComponent<Animator>();
animator.SetTrigger("AttackTrig" + 1);
yield return new WaitUntil(() => AnimationFinishedSript.animationFinished == true);
Debug.Log("Animation Finished");
}
}```
Currently, I Think what is happening is that the coroutine is being done multiple times. and the trigger keeps getting triggered. How would I make it so, that the trigger is only triggered if the previous animation in the list has been finished?
Hey again, would appreciate if someone could help me out
so im doing something rather unconventional, im using legacy built in renderer and im trying to make animated tiles
the tiles have animator with a single goal to swap material as if animating.
the reason im swapping materials instead of only texture is because the materials contain also normal and occlusion maps
The issue this leads to is constant load of materials without releasing it... how do i release it?
That generally means that the avatar of either the character or the animation have a problem.
There's way too much info missing to guess. Why are you even using a coroutine for that? What is your AnimationFinishedSript actually doing?
You don't need to swap materials to use secondary maps for sprites. You can just add them to the sprite data. https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html
it will animate the material?
No, it will animate the textures.
But swapping materials is one of the worst things you can do for performance, so you generally want to avoid it.
so how exactly do i animate textures? it only shows how to add secondary textures
do i use animator?
Yes. Totally normal sprite animation.
If you animate the sprite the secondary textures will animate with it
ok you lost me there..
so whats the role of the secondary textures? they hold normal map and such? or they hold the next frame?
They hold secondary textures.
Could be anything. Normals, occlusion, emission, flowmaps, whatever
You just have to make sure that the name matches the slot in the shader you want it to go into.
thank you! but i just ended up writing my own custom animator that will just animate whatever i need in the current material
for some reason my animation triggers are not doing anything, please help! https://gdl.space/feralewuse.cs
That script just sets a bool to true when the animation has finished using an event on the animation
Feels like the entire thing is somewhat overcomplicated.
Can you be more specific?
Guys maybe im dumb but i want to use animation layer just for attacks animations, upper body only. How to make my second layer not play anything until atacking?
I have a transition set to a trigger condition but when I trigger it in a script using that anim.SetTrigger(); it just goes back to the entry state instead of to the next state
So it is doing something, just not what you want. Do you have your transitions set correctly?
I do and its not actually making a transition just replaying the entry animation. This is coming as a result of setting a new animation curve in script
the transitions were working when I set the new curve in Start() but not when in another function
I'm not sure about the effects of editing the animation curves while the animator is running.
anim.Rebind();
anim.Update(0f);```
Not sure if that will fix it, since I've not experimented with editing the animation curves at runtime
You can use animator.SetLayerWeight() in a script to control that layer's weight.
yess, i figured it out allready, thanks a lot ❤️
Would be something like this var animator = GetComponent<Animator>(); animator.SetLayerWeight(animator.GetLayerIndex("YourLayerName"), targetValue);
ok good :)
theoretical question, is it hard to learn blender on "i will make my own attack and dodge animation" level?
Theres a massive amount of tutorials on that subject, I'd say go for it.
hard not impossible (maybe 5 hours to follow a tutorial and make it look good, 20 to be independent)
This worked and I cant tell you how happy I am!
I just realized, if you wanted to set individual poses to interpolate between for a blend tree, you would create them as animation clips with only a single frame, apply them to the motion parameter of an animation state, and remember to control the transition time between poses. Am I correct in this understanding? It's something I was concerned for, but I haven't had to use yet. I genuinely wasn't sure how to set just the pose for a blend tree.
Why are my animations returning to the center and not their startPos? https://gdl.space/toconuxusa.cs
how do i make an animator just refresh its values?
something like rebind but dont know how to stop the last animation
or if rebind doesnt call onstateexit maybe
Yes
You're setting the positions in world space I guess?
That was not it it was a bunch of annoying "set a new animation in a script" bullshit
but i figured it out!
Cool
Any idea why my FBX file with a model, materials and animation is 5983KB, but when I copy the animation data to a new file (so I can edit bits of it) the size is 41,491 KB?
I think Unity isnt detecting my keyframes properly
this animation goes from 0-40, but in Unity it shows up as this
(i cant enter a number higher than 1.3 for the range)
also why the heck does it say "1 fps"? the FBX clearly uses 30 fps
The copies of the animation are uncompressed text files for editing so they can be significantly larger than the compressed version in the fbx. Unity only compresses them again when you build the game.
40 frame animation x 30 fps = 1.3 seconds.
Unity animation is in seconds, not in frames.
huh
but why does it show the length in frames there then?
the seconds are on the timeline
like with every other animation in this project
okay so it's not actually a problem for the build, but is there a way to manually compress the animations? They're big enough to be a huge pain to commit to our repository, but we had to make them because the compressed animations in the FBX files aren't set to loop.
You can set the looping of imported animations from the import inspector.
Hrm, now that is a curious thing.
what unity version are you on?
hey for you it shows the length in frames too
but my issue is that Unity thinks the animations only consists of 2 frames
Like I said, it is curious. I hadn't actually looked at that animation but it seems to be different for different ones. I'm supposing it must have something to do with the metadata but I have no idea of the details.
When I click the Controller section of an Animator component to choose a controller, it lists every single controller in the project, most of which aren't relevant to the current character. Is there an easy way to filter these, for example based on the Avatar?
Similar question - if I'm picking a Motion when editing a Controller, it lists every clip for every character in the game, which makes it really hard to find which ones are the matching ones. Any way to filter this list?
Hi, can someone point me in the right direction? I have an animator with 9 positions to run forward/backward/strafe etc. But I also now added so the character I'm moving will look at the mouse by rotation around its Y-axis. So therefore the animator must someone rotate as well.
You would use IK to override the upper body rotation to point at the cursor
Or have another animation layer that overrides upper body motion with another blend tree for looking at other directions
Having an IK to override the upper body would make his torso turn basically while moving in one direction?
What I want to accomplish is that if I hold mouse on top of screen and run with W (up) I want to have full sprint there. If I change my mouse position to left of character and press A (left) I want to have the same animation but right now he's running in the right direction but animation is strafing left.
Hello, im struggling to import SVG files into unity. I've been looking in the package manager but anytime i try add com.unity.vectorgraphics i just get an error.
Can anyone help?
nvrm i unbroke it
hello, I have a character with animations, it has idle walk run etc animation, I want to add a weapon like a sword or a gun, but I want it to move along with the current animation, how could I achieve that? I child it to the hand bone, but it remains static not following the bone movement but rather the space position
Hmm what do you mean by space position?
it follows the position of the character's hand, but not the "swinging" of the hand sort to say
Oh so it follows position but not rotation
yeah
Weird, does the weapon have any scripts attached to it?
That would maybe alter its rotation
no, it's just a mesh
Or does it have an animator in it
it doesnt have any animator component on it
A child always follows its parents rotation and position, there must be some script or animation resetting its rotation
Can you screenshot your bone hierarchy and the weapon?
In hierarchy
I used animation rigging package, and created a rig builder, the rig asks me to constrain an object (the weapon in this case) and the source objects (the bones that it must follow) in this case the hand
Its a constraint atm, because when I tried to child it to the hand, the weapon would offset its position when moving the character
Well you shouldve said that first, instead of saying that it is parented to the hand
my bad
I havent used anim rigging yet, hope someone else can help you
Wherever you set up the constraints, try to see if you can constrain the rotation too
@manic sable would help if you screenshot your rig settings and constraint settings.
Anyone know how to get the animation speed of a specific animation clip in script? I want to find the speed for "Attack Right 2" in code. The clip may or may not be currently playing, I just want to get the value.
Post only once, on the relevant channel
sorry, didn't know which channel it fit best in
Also, anything you can tell or point to in the asset would help give clues how to solve the problem, what you tried, what the scripts do, etc
Having to download and install an asset and still have no clues what might've gone wrong in your end is a super tough troubleshoot
yeah, the only way i got it to work is by manually keyframing the x offset on the lava texture, which is what the scrolling UVs is supposed to do
You set the speed of the state you want to change to be controlled by a float, and you can get the float from the animator using GetFloat()
Alternatively, you can just get it from the script that is setting the float.
@hybrid tinsel I set a modifier that I'm accessing for the cooldown speed but I need to affect the overall animation speed to match the attack speed of the weapon now. I can't seem to access that property through a script.
I cant find any script examples of reading the speed of a clip from an animator. Thats what I'm currently looking for.
AnimationState.speed doesn't work?
I'm not currently playing the animation is the problem. The math I'm doing to convert my weapon cooldown to speed up / slow down the animation is hardcoded off the animation speed, it works but then I have to change code when my animator makes changes.
I just want to get the speed of the clip before I play it, change the speed according to my weapon, and then play it.
Was hoping for some super simple "GetCurrentAnimatorStateInfo(1).IsName("Attack1").speed" property, but can't seem to find anything usable.
nope, I thought I said they're read-only so the option is greyed out
hey, I did check and that wasn't the problem, the problem was that my constrained object was an empty without any children, as soon as I set the weapon as child of that empty, everything worked as I wanted thanks!!
The actual animation clip is read only. The file you imported has import settings.
how do i fix this clipping with my playermodel
That is AND. If you want to do OR, make two transitions with different conditions.
when renaming child game object of animted character, it becomes missing and i have to animate it again, is there is a way to assign that missing part again?
guys how to animate humanoid?\
Anyone have an idea how to animate tank tracks? I could make it using UV animation but I think actually revolving tracks would look better
ah
then it's good
- Attach the camera to characters head
or - Use first person animations that don't move around that much
How do you guys handle death animations for enemies that are killed in-air? I thought I could play the animation and have the rigidbodies drop to the ground by activating their gravity. Unfortunately the colliders wont work while the animator is still enabled, so they will fall through the floor. The only way I can think of would be not to use physics at all or disable the animator when the body is very close to the floor
try using ragdoll
Currently looking for a freelancer to help me set that up as i just can’t make my joints stable. So I was thinking about a possible workaround
you can watch these videos https://www.youtube.com/watch?v=X_HXJ11KAU0 and https://www.youtube.com/watch?v=DInV-jHm9rk&t=699s
in this video we gonna learn how to controll the ragdoll using scripting in unity 3d.
Let's set up Ragdoll Physics in Unity!
15% OFF for Web Hosting and FREE Domain included! https://www.hostinger.com/brackeys
Coupon Code: "BRACKEYS"
● Active Ragdoll Asset: https://bit.ly/2IWKpza
● Turning Ragdoll on and off: https://youtu.be/OJFS4Z0tT9A?t=276
● Bodyguard asset pack: https://bit.ly/2B9XUGA
👕Check out our merch! https://lineof...
How could i make it so my 2d character would have for example a seperate "layer" of animation that could like make them link or something independentyl of their walk cycle
Not an expert but I blended blinking and walking somehow. The blinking is too fast but having two animations on the same weight in animator is how I did it
hey all,
I have downloaded a character with animations. I'm trying to add an event (walking audio event) but the animation is readonly. I've been googling for the past hour and can't work out how to make it editable.
any tips?
ah. i worked it out. instead of using the "animation tab" I can go to the animation directly and click the "edit" button and place the event there. seems a bit disjointed, but i guess someone smarter would know why it's the way it is
Usually games don't render the player's own head for this reason, and restrict the motion of the first person body
would anyone know why an animation with 1 second in length would only play for a split second ?
it doesn't even have an outgoing transition
Is it expected behavior for joints to start glitching when an animation was played & stopped? Or is it necessary to manually stop/deactivate all physics before starting an animation and then re-enable physics afterwards?
does anyone know how to make my character not go into the facing camera animation when i'm not moving but instead keep it's direction
thank you!
maybe like have the bools for input stay until another button is pressed
good idea, thanks!
np
i used another blend tree in my case
so what does linear mean @brave storm
im not google
explain your issue here again and maybe someone can help you
this is my issue, why doesnt it rotate infinitely
why does it stop at the end
and then start again
you are changing only position tangents in that video, not rotation tangents
You don't show any relevant information so it is hard to say.
Only update the direction when the magnitude of the movement input is greater than zero.
Or, if using analog controls, greater than some tiny amount.
When I chance the "end" frame here it keeps snapping back to 1, why is that?
nvm, had the wrong 'source take'
if I have an IK rigged character in blender, can I still use the IK in unity? mostly for dynamic foot placement
someone told me that I had to rig it again in unity with a downloaded package
Correct
do I rig the entire thing or just the IK?
just the IK I hope
and for blender animation with IK, the animation will be baked right?
Correct
Bone positions and bone weights are transferable by FBX, but IK (which moves bone positions via code) is not
Hello ! Would it be possible to change rigs of a skinned mesh renderer at runtime ? To use a different set of animations
You can play any matching animations without touching the renderer/rig
But if you must play nonmatching animations from an entirely different skeleton, it's probably simpler to have one gameobject for one rig and animator which you disable and swap out for another gameobject with the other rig
If the other set of animations is nonmatching but similar, retargeting may be an option
@agile solstice Thank you ! Retargeting means converting an animation from a previous rig to a new one ?
Yes
thanks, I'll look into this !
so i got my animation done but why does it flip like that?
idk whats happening
i think its the flip sprite depends on direction thing
Hello is it possible to disable and re-enable animation for parts of a humanoid rig without having an animation layer & avatar mask for each part?
Oh now I've got another problem. How do you disable just part of the rig for the animator such that it's limp, floppy, physics engine hanging? If I disable the whole animator, the ragdoll collapses on the ground correctly. But I want just one arm to be limp. All I've done with avatar masks is make the arm stay frozen still, not animated but also not ragdoll floppy. (I think I might have got this to work in the past with a generic rig?)
Maybe I will make an invisible arm with physics enabled, and keep moving its shoulder to the animated model's shoulder, and make the model's arm relocate every fixed update to where the physics arm is.
Do it in lateupdate.
You don't need to do it 30-60 times per frame, you're only rendering it once.
:o
(Especially since most of those fixedupdates will be run before the animator is)
If you're using a humanoid, enable IK and have the arm's IK goal swing on the end of a joint?
mecanim vs crossfade and play()?
Why is my arrow slightly tilted when it tries to rotate 90 degrees?
That has a question mark but isn't a question.
What one is better to use
None of them are best for all situations. They are for different purposes.
guys , i m exporting a character and some animations from blender to unity
the fbx file if i open it with the 3d viewr has all the keyframes and plays smoothly
But inside unity i only have 1 keyframe per second
I m so stuck i need help i m going crazy
Yes that's a good idea. I used the Animation Rigging package.
Gah it turns out Unity's physics engine makes the forearm violently spasm if there's a lot of force on the hand. I can still make it work though. Maybe I will limit how far apart the object and shoulder can be.
have you checked that in your Rotate animation clip, it actually is straight at frame 42?
I'm trying out Unity's new hair particle system, which works great except when I add animation
it doesn't seem to follow the model's animation
and this is with alembic
I got a question, so I am trying to make an animated light source using point light.
However, no matter what light I use. My animations tab is grey and I can't select or do anything with it. Anyone knows why?
It happened with my main project (A VRC world) however, I just crated another clean project to test this out but it turns out to be just the same. Am I using this wrong or is it not working?
Hey All,
I have bit of a lengthy question so please don't rip me a new one.
I have a animator I have created assigned a model you see in the Player.png (black character).
This animator works fine. However, the trouble comes attempt to add the top half of a pistol idle animation as a layer to the base animation which also works fine with the exception of the top half being rotated and not centered like it looks before I drag it on as a layer animation. It's centered and forward before but crooked off to the left after.
I have applied root motion on the animation and root motion on the animator and that breaks it in a whole different way, but in theory I think this should solve my issue.
Any help with this would be so greatly appreciated. It's so tricky!
Images attached for reference
I can't understand why the animation looks fine then twists so much left
I have tried to mess with the offset but doesn't affect it properly.
You have your animation window squished down to hide the 'add an animator to this object' button.
Should look like
Because there is a serious twist in the spine in the animation- look at the difference in the foot positions for the two characters who I presume are facing the same direction
@hybrid tinsel Okay so I see where I can twist the spine of the pistol animation, so before applying the mask do I just align his legs with the same position as my character (or as close as possible)?
Okay so I squared up the spine and made a little animation where the up shoulders moved just a bit and applied that animation as a layered animation with a mask of only showing the upper body but when I hit play the upper body is not aiming the gun but the shoulder movements are there?
Maximize to see movement. Sorry for the small screen
TEST animation with arms out and slight shoulder movement applied as layer mask excluding the legs and only supposed to show arms on top or character.
Not sure; personally I'd handle the aiming with IK
I'm on mobile now so can't see very well
I copied and pasted an object a few times
and for some reason when one object's animation is triggered they all play
public string LogCollisionEnter;
public void KnockoutAnimation()
{
anim.SetTrigger(AnimationTags.DIE_TRIGGER);
}
void Start()
{
anim = GetComponent<Animator>();
}
private void OnCollisionEnter(Collision collision)
{
anim.Play("KO");
}```
when it says anim.Play KO does that trigger every KO in the scene?
and I guess how would I change that
Idle and Running animations are working whilst Walking animation isn't working?
#region Animation void DoAnimation() { float animationSpeedPercent = ((running) ? 5 : .5f); animator.SetFloat ("speedPercent", animationSpeedPercent/*, Time.deltaTime*/); }
This typically just happens to be a typo for me most of the time.
If I mistype a string name or overlook a boolean
double check those and let me know?
I put the code bellow, I mentioned running but I don't know how to type it for walking.
Hello, I'm a complete beginner, I'm trying to add a script to my character but it says "can't add script" ... ?
It's a brand new script I just created, I don't understand
I want the player to be able to simply press a button so that the character go from idle to crouch idle
Show the full error
Hey there, I'm working on a tutorial project and have a bit of an odd issue. I have a circular object falling from the sky in a straight line. I've animated it to spin around, and made sure that I've set the center point of the sprite to be in the actual center of the circle. It works fine when standing still, but as soon as I make it fall, it seemingly spins around a different point slightly off to the left.
Whoop I didn't see the message sorry, here you go
show the code
The error message tells what's wrong
What do you mean ?
I searched for that on the internet, people say that the class name and file name are the same thing......
Woaw I didn't see that, okay so I changed it but I have the same error ?
I did something wrong here ?
you didn't save the file
Ah jesus, thanks, something as simple as this and I'm already struggling, dunno what it will be like when I'll try to make a full game..
Is there any way to keyframe blendshapes (morph targets) on a bone/curve and then have those bones/curves keyframe exported and the data drive the blends/morphs in engine?
or do I always need to bake blendshape animations to a mesh :<?
I'm trying to share a rig on multiple models and all of the models use similar blends. I don't want to save those keyframes directly on the mesh and be forced to reanimate those blendshape keys on each model.
woah
cool
Hey, sorry for the bother, does anyone know if it would be better to animate STRAIGHT IN unity, or animate in blender and export to unity then tweak slightly if needed.
depends on the animation you're trying to achieve. do you have more context @white snow
Mostly single and multiple character animations in the settings of a fighter, building a move list, aswell as general grapples, which require me to animate both the grabber, and a one fits all "Grabbed" animation
Base animations in Blender, export, any blending of the animations in engine by influencing where the bones point to. I imagine it's similar to having an idle animation for a character and then influencing the neck bone to look at the player bone as they move around.
just with more steps
ideally your rigs are all similar and you can just animate to one rig size/position and you don't have to do that latter step of influencing the bones
curves are curves. You can copypaste a curve between a transform and a blendshape channel.
Or link them via code
What would I save the keyframes on? is it better to save them on a custom attribute on a bone or group in the rig hierarchy?
and then how woudl I look up that information from the rig? is there a special function to call keyframe data off rigs?
my google foo to search this kinda scenario is weak. I'm not sure how i'd phrase this
Hey all, I imported a Mixamo animation and it's just a blue block and if you drag it into the scene there is nothing.
ideas?
you need to look at some tutorials
You just have to make sure to turn on importing of custom attributes in the importer
Though I'd suggest just importing the blendshape animation as is and then you can copy those curves.
And of course, if all your models use the same blendshapes and use the same naming scheme you should be able to adapt them
ty pinball \o/
@trim hatch Thanks.
Hello, do you guys see an error in this ?
I'm just trying to follow a tutorial on how to blend 2 animations together with the input of the player
and apparently there is an error in my script, that the guy in the tutorial doesn't have, exept I'm pretty sure we wrote the same thing
Configure the IDE and it'll highlight the errors. Instructions are in #854851968446365696
Visual Studio is easier to set up than VSCode.
also #💻┃code-beginner next time
I thought it was this too but it didn't work either, I'm currently trying what Nitku said
I am trying to get models/animations from mixamo, but when i put them in my project they have to texture: how to fix ?
what is the problem?
using UnityEngine;
using System.Collections;
public class zombieScript : MonoBehaviour {
private Transform goal;
private NavMeshAgent agent;
void Start () {
goal = Camera.main.transform;
agent = GetComponent<NavMeshAgent>();
agent.destination = goal.position;
GetComponent<Animation>().Play ("Z_Run");
}
//for this to work both need colliders, one must have rigid body, and the zombie must have is trigger checked.
void OnTriggerEnter (Collider col)
{
GetComponent<CapsuleCollider>().enabled = false;
Destroy(col.gameObject);
agent.destination = gameObject.transform.position;
GetComponent<Animation>().Stop ();
GetComponent<Animation>().Play ("Z_FallingBack");
Destroy (gameObject, 6);
GameObject zombie = Instantiate(Resources.Load("Zombie1", typeof(GameObject))) as GameObject;
float randomX = UnityEngine.Random.Range (-12f,12f);
float constantY = .01f;
float randomZ = UnityEngine.Random.Range (-13f,13f);
zombie.transform.position = new Vector3 (randomX, constantY, randomZ);
while (Vector3.Distance (zombie.transform.position, Camera.main.transform.position) <= 3) {
randomX = UnityEngine.Random.Range (-12f,12f);
randomZ = UnityEngine.Random.Range (-13f,13f);
zombie.transform.position = new Vector3 (randomX, constantY, randomZ);
}
}
}
Hello, how do I change the transition speed between 2 animations ?
how to fix this
the animation i think the zombie when the animation start it go back then contiune to front
Why does my prefab removed animator come back when I create a build?
Hello I am wondering if this is a common problem I am having, with Unity's "Animation Rigging". The tip bone does not actually go where the target transform is, it is instead offset. This is with both the 2 bone, and the chain IK constraints.
It's not offset by the same amount in every position so I can't simply adjust the target position by that amount. Offset examples when the target was in different places:
Vector3(0.0666987896,-0.0212202072,-0.0188022256)
Vector3(0.0411155224,-0.0251646042,-0.0190845132)
Vector3(0.0289028734,-0.0264058113,-0.01510638)
"Maintain Target Offset" does not change this. Changing which bone is the tip does not change it.
hey guys "first time animating in unity"
so i made a annimationscript with statements bools etc,
how do i ge them into the code like my "run" bool set true ?
Animator.SetBool("Run", true);
like how do i set game object ?
Hi I have a very specific question that I'm having trouble answering and came across your post and was hoping to gain some insight. Into best practices.
When games like Call of Duty, Battlefield, and other AAA shooters model their characters do they create let's say a running animation with a rifle in their hand with no rifle in hand and then in the scene view lock the rile in place and march it's transform with the animation OR is everything (gun and character) all part of the animation itself?
Does anyone have any best practices or resources to review for things like this or professional experience to answer this?
Thanks all!
Assuming I understand what you want, you'd want to add an exit time to the transition out of the attack to allow the attack to finish first. Also, make the transition into the attack MUCH shorter; it is transitioning for the full length of the animation the way you have it.
Both transitions should be very short; just long enough for a smooth transition. And the ending time should be near the end of the clip.
ok but it looks like its waiting for the "idle annim to complete" before doing the attack annim
or now it works better
Did you put the exit time on both transitions or just the exit? If you put it on both, you'll get a delay before attacking.
You want the delay on leaving the attack, not on entering it.
hello, i have a run animation and an idle animation. however when the player changes horizonal input direction quickly (i.e. releasing a and pressing d to switch from left to right), the idle animation plays for a few frames before transitioning to the run animation which looks janky. what can i do to solve this? thank you
You could reduce the transition duration to zero, or use a blend tree
I’m not familiar with blend trees, I’ll look into them
And the transition duration is already 0, sadly
how do I make an animation out of multiple images
how do i make a pose for my character? i want it to be stored as an animation clip
click on the animator game object, open the animation window, click create an animation, press the record button on the animation tab, put your character in pose. Done
check youtube there are several tutorials on this
so i put my character in the scene to a pose i want?
you can do it inside the prefab itself, whatever u want
not too sure how can i put him to a pose. this is my scene hierarchy, animator is on PlayerArmature along with previous animations
Hi guys I have a problem when I try to rig animations. Basically I have two characters, the first imported from Mixamo and the second made by a 3d artist. I imported one animation from Mixamo (without the skin just the animation) when I use this animation on the Mixamo character I haven't problems while if I use the same animation to the second character he stands in the T-pose. So I made the humanoid avatar for both the characters and when I try to rig the animation using as avatar one of the two avatars I get errors like this : " Transform hierarchy does not match: Transform 'mixamorig:LeftEye' for human bone 'LeftEye' not found ". How can I let these 2 characters play the same animation correctly?
I need to make an avatar mask for a Spriter animated character, the Spriter importer doesn't make avatar's for the skeletal mesh and I seemingly can't figure out how to make an avatar from transforms or such. I have the animations, I have the skeleton, I just need the mask.
Using the Spriter2UnityDX importer for Spriter to Unity btw.
i have a hint attached to my two bone IK, but when i move it the arm doenst move
only when i move the target
why ?
it makes the arm look weird
Can someone tell why this happens??
Some parts of my animations dont fit in unity
They split or are out of place like this??
I hate it.. why cant it be like in blender... wtf im i doing wrong
Does anyone know why I have this message in the animation clips of a humanoid rig?
Detail: I reimported the model and set it to humanoid. I managed to configure some clips with "bake into position". When I applied the changes, the bake options disappeared and this appeared.
i have this VFX property variable that I want to manipulate with an animation clip. but how do i get it there ? i cant seem to figure out how to expose it so i can add it as a property in an animation clip
Hi there... who here does know alot of unity animstion.. i mean who here is a senior
I need really some profesional help
oy
does anyone know how to export mixamo animations from blender to unity without errors cause i haven't been able to do it yet
i am making a automatic door i have the script and the animation and it all works but the door closed to fast for me to be able to get into it
Why do you need to export mixamo animations from blender? Why not just get them from mixamo.com? Do you want them as humanoid or generic? (I have downloaded Humanoid animations from mixamo.com and they have worked pretty well - some tweaking needed for the models I use)
from mixamo to unity they work fine but if i wanted to take them to blender to modify them( even without modification) and back to unity i get an error when i try to rig the animation with humanoid and my character profile
Hey people I have a noob animation question.
There is a game I'm developing which goes well, but I have problem with animations.
I'm trying to add a "pickup, hold and throw" animations with chairs (Yeah chairs).
The problem is that I don't have any idea how to make the character hands hold the chair in a proper way...
Any suggestions?
Inverse kinematics is the usual solution.
Yeah I've made a research but haven't got solid understandment how and why to implement it. Do you have any suggestions for a method to use IK? I saw Unity has official package but don't know if its any good, also saw multiple asset store assets on that...
If you are using mecanim humanoids, IK is built in and can be accessed pretty easily through script. There is also the animation rigging package(probably the one you looked at), which is more complicated but works on any rig. I am not a huge fan of it but it does definitely work. There are multiple assets but I've not used any of them so can't judge.
There's a full explanation and example script for the built in IK here https://docs.unity3d.com/Manual/InverseKinematics.html
Yeah I saw it right now. I'll try it and see how it goes. Thanks!
What I usually do personally is set up a basic IK script that assigns weights and targets to each limb/head and then control that rather than controlling the IK in each script.
Got it to work It's so cool!. Now its the fun part of writing a good system
i have a swinging arm animation but i was wondering if it could hit objects and they would like move back like collision and idk if this would be a code or animation question
More #⚛️┃physics probably but I suppose it is a complicated issue with a lot of elements to it.
Question if you have the answer, I made a jumping animation that squats first then jumps, but in the game he floats (i think because of the Character controller?) does anyone know about this or have any input that would help?
My shaky understanding is "Humanoid" is a Unity concept. So if you take a Mixamo animation to blender, it just animates bones. You can edit it in blender, or leave it alone. When you export from Blender it would be a generic animation however. So you would have to convert to a Humanoid animation clip again when you import it into Unity - which requires things like an Avatar definition for the character (so it knows what bones to map to which muscles etc). Could you share the error message you are seeing and when it is coming up?
That is basically correct.
Mixamo's unity setting knows exactly what unity's importer is looking for and setup is pretty much automatic.
But if you modify things you might need to fiddle with settings to make sure it's all correct.
You also need to make sure that you don't change the naming of the bones, if you want it to find them
I have a character hand animation, and I want to move the gun together. But I don't know what to do.
Parent the gun to the hand bone