#🏃┃animation
1 messages · Page 31 of 1
Well, the way I do it is to have the parent be the player, with any physics etc. Then have the sprite only there for visuals.
Wait so the animator component would be attatched to the sprite child?
Like the sprite renderer and animator components would only go into the sprite child here right?
wait figured it out nvm thanks
someone can tell me why my audiosources are not played ? (dont work in play mode too)
Does anyone know how you're supposed to grab AnimationCurves from an AnimationClip? I need to bake it into a struct for something in my game and I'm unsure how to get the values. I tried using AnimationUtility.GetEditorCurve() with AnimationUtility.GetCurveBindings() but it returned a really big array which I think is giving me the curve for the animation motion itself (the bones and stuff) when all I want to get is the 3 named curves in my AnimationClip. Is this even possible?
how do i create a 2d curl up and rolling animation
Is there a way to avoid doing this and just match an animation to the rig
someone can help me 🥲
where do you call your void that play the sound ?
why when the bool Aiming is true the Aiming animation work properly but when I uncheck the Aiming bool, the animation don't play ?
On a script attach to my player
c'est le script que t'as envoyé ? parce que dans ce script tu n'appelle jamais ton void qui joue le son
check your transition arrows if they have anything assigned
j'utilise AudioSource.Play (oui c'est celui la)
oui, m'ais t'as rien qui appelle tes void, genre t'as rien du style
Play_Audio_Pop();
si dans l'animator avec la key event (le truc au dessus des autres key)
sur la deuxième image ont le voit
what can be assigned to an arrow ? here is the inspector of my arrow between "IdleAim" and "UnAim"
il faut faire une transition dans les deux sens comme sur la photo
pourquoi ? parce que j'ai envie de faire mon animation que de la position de visée vers la position de base , pas dans l'autre sens
ba tu prend l'aim tu le duplique et tu active le mirror
bah je connaissait pas donc je vais pas trop pouvoir t'aider sry 😅
pourquoi j'ai besoin d'un miror ? ça passe pas si j'ai fait 2 anim de transitions différentes ?
en gros dans ton cas tu veux que quand aim est true alors la transition IdleNoAim se fassent pour aim puis tu met la meme transition qui passe de aim a idleAim et enfin si ton bool aim est false alors tu fais pareil mais dans le sens inverse
si sa passe mais sa sera plus fluid d'inverser ta première animation
genre comme ça ? (parce que la ça marche toujours pas xD)
@fresh orchid @topaz fractal This is an english only server. You can take it to DMs if you wish.
je pense que comme sa sa marche (NoAimIdle devra etre orange)
srryy
sry
that litteraly what I've already done but it's not wotking like it skip the reverseAim animation
can you show me your condition IdleAim --> UnAim
I found what was the problem ! thx 😁
ok
goodluck 🙂
I hope you will find a solution for your problem too 😁
I have two different SkinnedMeshes, both using their own different skeleton, and, Humanoid Avatar. this works and allows rather good re-using. i am trying to find a way to re-target though, so i can then Export the Animation, as attached to my custom character. This will allow me to take the animation into animation software to fix minor details. I understand that i can edit the original animation on the original mesh, but that is not what i am looking for. I specifically want the Animation re-targeted and attached to my custom character mesh, and exportable this way, in FBX form.
I have tried some techniques from the Docs, but in the end, that just ended up exporting the root transform. Not All the bones
You can just export the animations and apply them in unity with retargeting
What have you tried?
any reason why this isn't working? I've tried deleting th ewhole animotr + clips and making them again and it didn't work
Hello! I am transitioning from an idle animation to another one using a trigger. How can I go back from the other animation to the idle one after it ends?
Just have a transition back that uses exit time
hello ! is there a way to call a void when an animation starts? for exemple call a void that handle the shooting sound and the shell ejection of my gun when this animation is played ?
Yes. You can either add animation events to the animation clip, or add a state machine behavior script to the state.
ok thx 😁
Hey is there any 3d artist here?
yes why ? (not professional but still over 3000h of blender xD )
Why is it that when he flips to the left one of the frames shifts him out of place?
Tons. Best to just ask what you need
do you know why I can't play and add animation event to my animation ?
Pivot in the wrong place?
It is read only; either make a duplicate to edit or add events through the importer.
I duplicate the animation but I can't edit it
I don't see 'read only' there, are you sure you can't edit it?
oh you're right, I can add animation event! but why I can't play the aniamtion or click on "Scene" to see the thing that are hide under it ?
why does my animator event look like this and not like on every tutorial on Youtube ?
Dunno, that looks normal to me
Do you have it added to the animator and the object selected?
the UI change for the Animation Event in the inspector ?
thx it worked ! 😁 I can now play the animations !
you make my Animation Event work at the same time ! THX ! 🤩
The two versions of the ui do the exact same thing; one requires choosing the function before entering a value.
Ohh Ok I see !
I want to make a 2d video game so bad but animating 2d pixel arts is very hard for me. Should i dive into 3d stuff?
if you're not good at 3d modeling it won't be easier
but in both case you can find a lot of free stuff to make game without having to draw or make 3d model
Can someone help me? I have to sync two rig's animations to the point where one rig is always synced to the other. What I mean is that I have weapons I want to have animated with my arms, but I am having issues with keeping them synced. I presume that I just need to have both animation controllers use the exact same transition times and settings, but I want to know if there is a better, simpler solution to my problem.
I keep getting results in my searches that do not help whatsoever, so I thought that I'd ask on a few forums/servers
What advice would you guys have for making a horde of zombies feel a bit more natural in how they interact with each other? The way I have it now thet just kinda stand around each other politely idling and walking in a little bundle keeping their social distance and it feels a bit wrong.
I suppose it depends on how you're controlling them. You can have their animations change based on proximity in all sorts of ways.
They all walk along the same path since its tower defense but there's a bit of randomization in their movement. Only thing I can really think of for proximity is that they can have a chance to be pushed over and ragdoll but that feel a little unnatural in practice.
Is there a way to change the width/height with DOTween?
I'm 9splicing so I don't want to tween via scale
guys, how can i fix this? looks weird
Quite a few things I do not really recall. you said "You can just export the animations and apply them in unity with retargeting" can you point me to a doc or something that demonstrates this?
@lime socket related to your question here:
#💻┃unity-talk message
Animators can only animate the properties of objects that are children, or attached to the animator component itself.
Right, so if the model I am animating is a child, I can still target it if the animator is on the parent?
My brain is wired to godot atm where you'd just signal upward
Like the parent has the attack methods and stuff, so I need to have the animator trigger those
You cannot do it directly.
HOWEVER, I think that you can move the animator from the model to the parent it will still work
This is your current setup, right?
MyPlayerPrefabNoAnimator
------ThePlayerModelWithAnimator
yeah, it's just like I want to move the model too without affecting the colliders
so having the model on the parent wouldnt work
it needs to be controller -> visuals
I don't remember 100%, but I think the Animator is actually a bit cheeky, and if you move it to the parent, it will actually animate the children as if it was there.
yeah, let me mess around with it more I guess. I don't usually use animation events and do it all in code, but since I'm adding forces to my attacks it makes it easier to time
Try moving the animator from the model to the controller, and see if it works, I think the animator does a search on the child objects to search for the "correct root" if the current object isn't correct
If that does not work, here's what you can do:
Ah.
If you need, do the following
The fallback I can think of is delegates from child to parent
Yeah that's what I was gonna suggest.
Or the child just sends the animation event itself upwards
hopefully not cause I got a lot of methods lol
Are you using "OnAnimationEvent"?
Uh, was just going to use the property accessor from the timeline
Lemme do a quick test here cuz I also don't remember 1 sec
there's both animation events and property accessing
Seems like the delegates are the idea
or bi-directional references
Yeah, so, you can animate the properties directly on the timeline, or you can send events.
You can invoke a set of events based on their signatures.
there's no actual 'target' property on the animator controller. It seems to only affect the game object it's on.
Yeah, it only affects the object it's on
You mentioned you had a lot of methods right?
Eh, like a addforce, and specific hitbox activations
if it helps
You can try to setup the "next" attack data when entering an animator state
But you'd still have to send it up the chain one way or another when the animation event triggers
yeah I got the info when it starts and when it ends, it's mostly the data of when the animation is at a point is where I need the timeline information
of course I can just manually resolve it per clip
too much of a pain ;)
Was using godot on my previous project and you can pretty much reference anything on the prefab for the events
The way I did a simple melee mockup a while back was (going off by memory):
Sword has a trigger colider.
Animation turns on/off the sword colliders etc.
Sword receives "OnTriggerEnter" from physics, and sends it to the controller.
Controller has an information of current "AttackMotionData" which contains the damage multiplier, knockback forces etc etc
AnimatorStates have a "StateAttackMotionData" StateMachineBehaviour, that when it receives OnEnter, it tells the controller it has been entered, and tells it what's the AttackMotionData that it contains.
The StateAttackMotionData is either setup in the AnimationState itself (inspector), or the AnimationAttackMotionData has a string identifier that I type in the inspector that the controller uses to find the correct states and sets the data itself using Animator.GetBehaviours on Awake.
Yeah, but the take away here is you do need that middle man script to relay that information upwards. I was just seeing if I could do it on the editor but doesn't seem that possible which is odd.
Thing too is that Unity does encourage you to stick visuals as children
Yeah. But do try placing the animator on the parent
I think it animates the children properly even if the "root" is different
unless they changed the behaviour, cuz I remember years back adding an animated character as a children of a controller, and just moving the animator up and it just working™
Ah, maybe you're right. Problem too is I'm not sure of the whole force implementation but maybe I'm overthinking it
It's like I want to move the model locally sometimes, and sometimes I want to move the whole object.
but it does seem like I can just target the child object and move that alone
you need to add some 2D blend strafing to your animator
Ah, actually just calculate angles from your forward direction, and anything beyond 90 or -90 you'd rotate your character towards
Are you using root motion?
Cuz if you are you can manually animate the child with the root motion the parent receives in the uh... onanimatormove callback?
you can probably just calculate angles and use lookat if you don't care about stiffness
anyway, chores, best of luck~
Using animation rigging package for IK stuff and for some unknown reason it has decided to set the default position of my bones?
I have this ball robot that extends it's legs like so.
I achieve this without manually animating the bones in Unity by animating the weight of the rig, but it's now set the default position of the bones to the open position so setting the weight of the rig component doesn't work
does anyone know what caused this? It's basically impossible to manually get the bones back into their original position so I have to redo everything and I don't want to redo everything just for this to happen again
is it because of write defaults or something? The only thing that was animated was the weight of the rig component.
I have a bone that i want to scale based on another bones rotation from Rest. I am currently using a simple script, but i was wondering if there is a more 'built-in' way to do this. perhaps within the animator
It has some swag not gonna lie
Seems like you want to mask the top half of your model
So the legs aren't affected
https://docs.unity3d.com/Manual/AnimationLayers.html
You can create the Avatar Mask to only affect the chest/hands/arms
Glad to help 
Hmm, I just realised that only it's hands move
Rest of the body is static, kinda looks like an airbaloon man lmao
But I'll head to bed now I guess
Blend the layer weights to make it feel more natural
hahaha I love being stuck on this.. I'm trying to make some poses for my hands with blend trees. I've got my hand fully extended out in an animation named "Idle" should this only be frame 0? Should the other ones besides "Idle" consist of 2 frames, 1 being idle and 1 being the animation I'm trying to pose it in? Or will it all just be 0 frames.. I setup all my animations and tried it out and the blend tree refused to actually move any of the joints.
I wonder what you mean by "will it be 0 frames" in this context
The blend tree's function is to blend animation clips together, it doesn't alter the keyframes within in any way
Your poses/animations will have just as many keyframes as you author them to have
If the animation clips won't work when played solo in their own state, they won't work in a blend tree either
Oh well yeah nevermind I'd need 2 frames?
It's built to be a hand in vr, meaning I only really have to make a position. So like
- Idle Animation (hand is flat)
- Fist Animation (hand is clenched)
- Finger point Animation (hand is clenched with pointer finger extended)
So on so forth. The animations I think should only have one frame, because the blend tree would just motion through it based on how much pressure is put on the triggers or grips or if the a button is pressed. Do I have to end up making certain animation changes? Like fist to thumbs up or can it all just be frame 1 being open hand and frame 2 being the position. Does that cause issues if I'm already having my hand clenched and I try to put my thumb up?
Or would it just be 1 frame?
In this situation you would have a one-frame animation for each pose
I know the thumb looks janky I was just trying to get an example but is this how I'd do it? Or do I need to like create a new keyframe for all the bones er?
Looks like the correct process
Okay so right now I have it set to be
If left clicking & right clicking = 1/1 we do a thumbs up
If both are at 0 = 0/0 we do idle which is open hand
I want to make it so if you are doing a fist, and "J" is pressed it will put your thumb down and cause a fist. How could I do that, there is no "3D Cartesian graph" do I have to do something with more blendtrees?
I'll be converting it to use the oculus grip and trigger and j button later just making sure I can do it this way so I don't have to deal with putting the headset on and off over and over
Well, you can have a more than 4 motions in a 2D blend tree to blend between, but you start running into the issue that there's no direct blend between each pair of motions that would not cross over a third motion, or cross over the center first
The workarounds are to have blend trees of blend trees, or blend trees on separate animation layers but you would need some extra code to micromanage the weights to make sure you aren't partially blending to a previous motion by accident
Yeah the issue isn't the lack of motion it's the lack of parameters
Okay I'll look into doing a blend tree ontop of it
Perhaps a simpler option at that point would be to make them separate animation states that you blend between using animation transitions, rather than a blend tree
Since hand gestures can change rapidly, you'll want to make sure you understand transition interruptions and have them set up correctly in that scenario
https://www.gamedeveloper.com/design/unlocking-unity-animator-s-interruption-full-power
im beginning with pixelart could someone pls just give tips on how to improve YT creepy7677 thats where I got all the vids
If you want guidance, you'll need to ask about a specific issue you are facing rather than just advertising your channel
I wanted help on the gradient on things how I could make it look better
You still need to explain the issue
that the overall picture does not look like it belongs all together
its like some things are not mixing in
the backwalls and stuff
That does not sound like an animation issue, or one for any of the channels
The server is meant for issues related to Unity, not art in general
I'm importing some animation made from blender into unity, most of them are ported from mixamo, and some are then edited using animation layer.
I've noticed that somehow in few animations ported when ported on unity they dont work, tending to go fully or partially in T pose
Any idea on how can I solve this? I've found nothing similar
could anyone help me figure out why im getting weird deformations when i try and change the root node for a model import from blender
Well, most third party tools give you a lot more... well, tools to use. But doing it in unity can be good if you have specific needs and especially if you are good at writing your own tools.
Why Configure Avatar button not showing up? Is this because the error? How you fix this error?
There is a bone for 'LeftLowerLeg' but unity says it missing..
Yeah, but it isn't named what the avatar is expecting. You'd have to open up the avatar and put the right bone there
Yes, but there is no Configure Avatar button.
This image. after click configure, there is no button here to show the bones in Editor
This is my editor when I click Configure button from Rig inspector
This is from different FBX, as you can see there is Configure Button there that when I click, it will show the configuration screen
Like this right? But this is not the case for my other FBX that I ask earlier. The thing is, both FBX have same rig.
Okay
Not sure if this falls under this channel. Is there a way to seemlessly transition videos in Unity with the VideoPlayer? I am trying to sequence 2D animations with it, but it always has a stutter before the next video starts.
Hello, I've made this shooting animation , but as you can see the firerate is not really fast, so I wonder how can I make FullAutoShooting ?(the gun I'm using shoot 10rounds/s in full auto)
You can make a transition from a state back to itself for rapidly replaying it
oh thx! I tried and it work ! 🤩
Guys is there a way to use animations made in Adobe animate in unity?
Is there other websites to get free animations than Mixamo? Anims there doesn't seem to work with my character
If mixamo animations don't work, you might have trouble with any generic animation files... might be worth looking into what the issue is, to at least know what you need.
Convert them to a video file or a sprite sheet, usually.
Heya! I'm not sure where to ask this but I'm running into a hiccup.
Im importing a cod model+animation in a unity game but I noticed there's A LOT of these weird jittering issues, in blender it looks fine!
I've tried disabling animation compression, I've tried disabling all animation optimization in blender, I tried all the tricks I can find but no avail sadly, and with me being EXTREMELY new to unity, I dont even know where to begin.
What I have noticed is when the right hand has animations that moves further out, thats when the jittering gets worse, I'm sure its due to the fact that the gun's root bone is parented to the right hand (Both gun and hand is the same bones actually, just how it works for cod animations)
Ah yes... Average hand animation system or just me
Hi everyone,
I'm facing an issue with the scale of a character in my Unity project. When I adjust the Scale Factor in the import settings, the character's arms, legs, and neck get stretched and look weird. I want to keep the scale in the scene at 1, so adjusting it there isn't a solution for me. I've also checked the rig and animation settings, but the problem persists.
Has anyone experienced a similar issue or can provide any guidance on how to fix this?
Thank you in advance for your help!!!
how did you exported your caracter from blender to unity ?
Hey, I've been trying to figure out 2d rigging using Animation2D and all of the examples I've seen are using a sprite that's rigged for 1 direction. In the case of having a character who moves up, down, left, right would I need to have a separate rig for each one of these? and also how is this typically handled in Animator?
There's sprite swapping to swap the appearance of the character while keeping the skeleton
https://docs.unity3d.com/Packages/com.unity.2d.animation@10.0/manual/SpriteSwapLanding.html
The technique is often used for faking 3D rotations of body parts of a 2D rigged character
But if your character seems entirely different when facing up/down vs horizontally, it may be simpler to just make a different rig to swap to altogether
Animator has animation layers, including synced layers, and the Animator Override Controller component to swap animation clips of an animator while keeping the state machine
For example if you want the animator to keep swapping states according to input, but swap the motions based on turn direction, either with the synced layers or override controllers
did you export the gun and the arm in one file ?
try to put Simplify at 0 instead of 1
no i export gun and arms separately
i wont work :/
ok , I got a question, because I am making a fps to, but I didn't manage to export both separatly due to the constraint I put in blender and also do you have 2 different animator in unity ?
probably unity cant detect child of constraint in blender
Yes if you put constraint in blender, they disapear in Unity
try to bake your animation in blender
i tried but nothing changed :/
I've got the same type of problem so I exported my gun and my arms in one file, I know it's not the best way and the most professional one , but now at least it work .
Is there any way to get finer grained control of the Muscle Slider on the Humanoid Rigs?
I understand i can adjust the limits, but i mean, for example, the Arm Down-Up the slightest movement of the mouse makes it move too far
I thought there are saveable settings?
Does anyone know of any tutorials on how I can create an animation in Procreate Dreams and use the animation inside Unity 2D?
Hey guys! I am a beginner developer and am currently trying to add animations to my 3D character, I have already created an animator, assigned it to the character and before the scene starts everything looks cool, but after the start all the animations for some reason seem to fly up a little, although the collider is on that same place. I've been trying to solve the problem for an hour now. Has anyone encountered this?
Below are screenshots before and after the launch of the scene, and animation in the inspector (animation separately from the animator and animation in the animator)
I fixed it, nvm
Is 3d animation easier if i can t draw to save my life?
Depends on why you can't draw. If you have, like, issues with fine motor control then animation may be easier physically.
getting no errors with import and my rig seems fine (used rigify) but entering the "muscles and settings" tab does this to my character. What's the deal?
unless rigify just doesn't export properly for this humanoid system, which is probably the case
Rigify rigs are not intended for realtime use (or any export), as far as I know
There's a lot of issues even trying to export generic rigs
wtf is rigify for then
damn
in that case, how can I keep all the hours of weight painting that I did while ditching the rigify part?
for animating inside blender
gross
I mean I plan to animate in blender
I just need it to work as a unity humanoid for stuff like inverse kinematics
How can I solve this back breaking problem?
You have some options
Data Transfer modifier can move weight painting data from the DEF bones to a different armature that has matching vertex groups
There's the GameRig tool that can has anologuous Rigify rigs with a correct hierarchy so they can be exported, but this one has not been maintained and only works in a bit of an older version of Blender
There's also Game Rig Tools which is proprietary but should support the newest Blender, also right now as part of a charity bundle
Either of them might have some utility to convert an existing Rigidy rig to a Game Rig but I don't recall that with certainty
Depends how you vision it to be solved
I have no idea how to solve it so I need help 😿
Do you have any ideas on how I can solve it? @agile solstice
First you'd have to decide if you want to rotate the lower body to match the aiming direction, or even out the twist of the upper body to face the aiming direction without changing lower body orientation
I want the lower body to rotate, but I also want the character's head and upper body to follow the weapon, can I do that?
I don't see why not
Hey all, I'm currently making a "multi-item" (can swap weapons) equipment system using 2D sprites imported from Aseprite, currently I am using animator override controllers which override base animator controller logic (for example: a "Magic Sword" would be an override controller of "Sword" and replace all the respective animation clips inside to that of the equivalent "Magic Sword" animations). However, in my current logic I am using/planning on using animation events to tell my player's Statemachine that the attack is over, and to change states back to idle. However, my issue now is that since the override controller cannot seem to persist the animation events on the override controller (since they are a component of the animation clip themselves), I would need to then add animation events to every single item's animation clips which would be very tedious, and I am just wondering if anyone knows of a way I could circumvent this and either have animation events be linked directly to the base animator controller, or if there would be a clean way of alerting the player script, when an animation is over without events at all. Any tips or help would be appreciated, I'm still quite new to Unity's animator and would love to hear what you all would recommend, thanks!
As a concept would this work efficiently?
You can use StateMachineBehaviour scripts instead of animation events, perhaps?
Yes maybe, I'll have a look into those. Thanks!
All my pixel art animations look bad
My mind can t deal with the different colors and positions
hello im running into an issue with the split bone tool, no matter what i press it just doesn't want to work
all im trying to do is familiarise myself with the usage of these tools, by trying to split the lower arm bone to create a bone for the hands, however it doesnt do anything when using the tool
i should be able to move the bones with the preview pose tool, but that doesnt work, im confused on what im missing thats causing the issue
none of the bone tools work apart from just creating a bone and im completely lost
I just ditched rigify and restarted entirely but ty
This is personal preference kind of question, but which hand do you guys parent weapons to? Left or right?
What version?
@hybrid tinsel 2022.3.5f1
do you know why sometime my reload animation is playing twice, and how can I fix it ?
Sorry, I meant 2d package version. That package seems to get buggy updates a lot
I stopped updating it a while back
the psb and 2d animator packages?
ill check them now
the PSD importer is 8.0.2
2D animation is 9.0.3
@hybrid tinsel are those the 2 you were talking about
I'm not at home right now to check which versions have known issues
Though you could check the forum I guess
if you end up finding something out could you let me know pls? i suck wth forums and the like, id appreciate it a lot!
...ah yeah, the forums moved
Does a transition wait for the animation to finish playing if a transition condition is met?
I am getting a strange issue where my animation is looping through around a hundred times a second, and I suspect it may because I have a StateMachineBehaviour script which sets "active" to false every time it enters which may be cutting the animation off and looping it.
Hi. Is there a way to get the instance of Avatar that the AnimationClip was imported with? Editor only way is okay.
I'm trying to make a tool to assign animations to component properties quicker.
do you know how to manually change the packages versions?
probably ask #archived-code-general
Thanks, I started there and was sent here, but I found the solution now
I sent them here because it is related to animation. Code related to animation is fine here
I actually thought i was in the General Chat. forgot i deposited myself here to ask a question! 🙂
I keep doing that too haha
In a blender model, I have an animation that changes the rotation. location, and scaling of the model. When I export this as an FBX to unity, the animation includes rotation and location of the original animation, but not the scaling. How do I include the scaling in the animation.
Here are the export settings:
And here is the animation settings:
If animations I build in Unity make my character slide around a bit, like the feet, do i need to be enabling Bake Into Pose , or changing the Based Upon setting for the animation in Unity?
like I export them to another program and the character kind of slides the feet around a bit, they're not really grounded as they do the animation
Depends on if an exit time is set
You can choose the installed version in package manager
Is it set to humanoid?
Yes
I figured out the issue, my exit time wasn't set however my script was setting the active parameter to true which instantly would call false and cause it to loop through my idle and attack states, appreciate the help though!
Where do i go from here?
im really new to unity so im not sure
im honestly still completely confused on why these tools just wont work for me
the only thing that works out of all of these is create bone
noithing else works, it just randomly brings up this blue box that highlights my whole screen whenever i left click with the tool selected
i have split bone selected here, yet left clicking the bone just brings up this blue box
when in every tutorial ive ever watched, it just splits the bone like its supposed to
anyone able to answer mine?
Need to unlock, and I am not sure which version is best for your unity version
What's the standard for attaching weapons to a character's hand? Should I parent the weapon to the hand in blender with constraints, or do it in Unity? No matter which way I do it, I'm going to have offset issues when I export to Unity.
like I can make an empty in Unity on the hand and parent the weapon to it, but then I can't have any sort of offset in blender while animating
Can't you just do a weapon/prop bone under the hand, have the weapon weighted to that bone, and then animate that?
I could, but the weapon model is entirely separate
in blender I'd use a child of constraint, but then that creates issues when exporting to Unity because it has offset from the origin
Can't you animate with s placeholder in blender, then replace it with your weapon in unity?
hello, i need some help, the state doesn t switch, just mannualy, and i dont now why
this is the code
Hello, for my multiplayer Fps, how can I tell the other customers which animation to play? I was thinking of sending the other customers the animation I'm playing, but if I do that the transition between the animations won't be smooth, since they'll go straight from animation A to animation B. How can I do this?
You canjust send the same animator commands to them, right?
yes, I had thought about it, but I hadn't found a way to do it, but I think I finally have a way to do it. Thanks for your help !
is rigging every hair strand like this going to have a big perforamcne impact if I am playing animations on every hair strand at once
I have my weapon imported in blender, but it has moving parts so it needs to animate along with with the player rig. I can use a 'child of' constraint in blender to make the gun follow the hand, but then when I export the weapon rig to unity it has a huge offset when I parent it to the hand bone.
I know how to animate and all, the issue is just the exporting and various constraints that are messing me up
the object origin seems fine to me. But it seems like when I export the gun, it just puts the object origin at 0,0,0 even though it's clearly not there in blender. And the result is that my player isn't holding the gun correctly in unity.
It probably will be fine, but you can also just not rig every strand if you wanted to optimize it. https://i.imgur.com/8zSjTX7.mp4
Like here, you can see I used barely any bones
is it different for 3d?
Not really, though 2d is of course usually less expensive, and a lot depends on how you're animating/rendering it.
i take it the performance of a bone depends a lot on how many verticies its weight painting affects?
like would using less bones even matter that much if you are still affectiing the same amount of verticies?
Well, dynamics are expensive.
You can of course go overboard
For 3d, a lot depends on the type of hair
dynamics as in physics calculations?
Yeah. Or faking them
I gotcha, I was planning on faking them as simply as possible, if that is possible lol
im looking into if you can access bones by script rn
In some cases you can skip bones entirely and do cloth sim or something
yeah id prefer to keep it as simple as possible in terms of calculations because this a model for a multiplayer game and there will prob be like 5-10 people in hd range where the hair will be animated at a single time
why is my animation laggy in unity? I exported as fbx and baked animation
Has any body knowledge on active ragdolls. Because im setting a target for each joint and that works fine. but when i rotate the Target model it just start crumbeling?
Just from the look of it it appears that the rotation is happening twice, once for the mesh and again for the ragdoll targets, but compounded if the targets inherit the mesh rotation as well
Oh
should i just rotate the other way on the mesh?
If my guess is right, you'd only rotate mesh and move the ragdoll targets only in local space when needed
Or separate them from the hierarchy and move them independently
i have seperated the BodyParts from the parent but the bodypart still twist u have any other idea?
This is probaly the Easiest way to do target rotation and probaly the worts
for face animations, is the standard bone animations or blendshapes? Or a mix of both?
Assuming I'm doing it by hand, without mocap.
so my animation blending or transitions or whatever worked fine when i was using the Character Controller GetAxis, but I changed it to GetAxisRaw to make it more snappy but the now the animations dont transition, its very obvious when crouch walking. how do I fix this?
does anyone know why my animations looks like this
its like double stacking the frames
Show the sprite import settings
Ok, filter mode is good. Thought that was the likely issue
can I map this generic animation to these bones?
just like should it be possible?
im going to create a script that can take generic animation clips and create a new animation clip with certain bone names. If this sounds like im overcomplicatiing things lmk thanks
Point filtered sprites will appear like this if they are not rendered at a very specific relative size, such as with the pixel perfect camera component
To eliminate the issue you will have to use the component, or use bilinear rendering with mip maps to render them in a smoother way, additionally with some AA that works with sprites such as a high Render Scale or a custom sprite AA shader
#🖼️┃2d-tools would be the correct channel
Hi,
can anyone please tell me how to access a animation (animator) in the canvas from script, that have been placed in the player Game Object?
If i create a Animator variable in the script and attach the canvas, the game runs into an error
The same way you access any other animator, or a component, from a script
ok, but i havent access any animator from a script yet, just one that is inside the same game object. If i disable the Animator, to not start from beginning, there is no access possible as far as i know
You should be able to get a refence and call methods to a disabled component just fine
Guys, how do I change the image source (Image Component) in Animation? Whenever I try to change it, it sets all the other keys with that new pick image.
What other keys?
frame 1 is set to image 1 and frame 15 is set to image 2.
Are you actually recording the animation?
Yes
I can literally see two different images in the timeline but whenever I play it. It doesn't change.
Wait, is this possible in Unity?
Why has this happened to me 😢😭
Great. Now nobody talk about this.
I'm trying to help you ask the right questions even if I have to do other stuff too
I don't see any clear cause for that problem, and doing the same thing on my end works fine
I'd try restarting the editor for starters, or re-making the animation and controller
wtf are these things on my timeline and how do I remove them? I can't undo adding them, I have 0 clue what I pressed to make them appear (to my knowledge I never pressed anything), and when I try to preview the timeline it can only play in-between these markers.
Hello, I just started making games with Unity and I need to make animations but I can't use it here. In the video I watched, when the man opens this place, he directly says create, but he doesn't.
Yours says "no animatable object selected" which is the issue you have currently
How exactly can I fix it?
I started unity 3 hours ago
When I look at YouTube, it pops up immediately when people open it.
because the animatable object is selected from the Hierarchy
Thank you, I've been trying for about 40 minutes
Not sure what to drag into the preview box. Tried sprite, spritesheet, animation controller, nothing works
"Model" sounds like it's for 3D, but I'm using this for 2D
can I retarget the bones of this generic animation?
I set my samples for an animation to 60, but it's visibly not moving at 60fps
Much slower
looks more like 12
Oh nevermind, I see the problem
The sprites were spaced out in the timeline
Not using the built-in retargeting, which is part of the humanoid system. You could write your own system to retarget if you wanted to, depending on your needs.
I already tried writing a script but I found out that unity's api doesnt really support it for mecanim
i'm trying to see if its maybe possible to rename bones in unity and trick it into working, but so far changing the name doesnt seem to matter
is there anyway to retarget generics?
So, I'm trying to have my player character thrust a sword forward at a target using animation rigging, the actual thrusting motion is an animation I did in blender and imported. The sword is parented to the hand only, it doesn't have any bones.
So I have two questions:
- The hand's rotation doesn't seem to visually deviate from the original pre-made animation but the sword, which is a child of the hand, DOES point to the source object via the constraint. - So what would I need to do to get the hand (and even better the arm) to also follow the constraint like the sword does.
- Although the sword very obviously is responding to the constrain component, it doesn't actually "stab." Towards the end of the animation, it kinda curves around the target, almost like trying to push two magnets together that are facing the wrong way. - Is there a better of setting all this up?
I have a blend tree, but it's not blending the animations - is that only available for 3d rigged modes or animations with high frame rates or something?
It will blend properties, but not all properties can be blended
For example there's no possible blend between two different sprite references
What do you mean by properties?
Like... size?
So, if I have one animation stretching the character horizontally, and another vertically, the blend tree with blend them and do both?
You'll have to be more specific about what you want. The mecanim retargeting is only for humanoids, and since it involves conversion to a humanoid muscle model and back it doesn't really apply to non humanoids. Do you just want to remap transforms, or do you actually want to remap motions from one hierarchy to a different one, or what? What are you trying to do?
Components have properties, being the values and references you can change
Basically the only thing the Animator does is override those properties with data from your animation clips, and optionally blending the data from the clips before overriding
If your horizontal stretch animation sets scale to 2,1,1 and vertical stretch to 1,2,1, at halfway blend the scale would be 1.5,1.5,1
The sprite of a sprite renderer are a references to specific assets, there's no logical halfway point between two sprite assets, so blending is ignored and it simply snaps to the other sprite at halfway blend
That makes sense
I wondered if it'd be frame splicing
So if you had L left walk animation and U up walk animation, it'd blend to
LLLULLLULLLU
But that might look a little janky
It could be done using motion vector blending(and in fact unity has a system for that, used in particle sprite blending) but that isn't usually used for characters.
two same structure hierarchy with different names; i found a $30 asset that would prob work if i cant figure anything else out.
What programme would be the easiest to learn to animate ? Lets say i wanted to learn myself to make a quick animation such as drawing a bow or waving, what is the most user friendly ? Muse Animations havent helped me in any way
For 3D Blender probably since there's resources for it
But it's unlikely to be easy
Unity animations are based on hierarchy and names. If you just rename the transforms to match, and the hierarchy already matches, it should just work.
does the hierarchy have to be the exact same? Like can it be the last three children of a 10 bone hierarchy vs just a 3 bone hierarchy?
The hierarchy relative to the gameobject with the animator.
It really is as simple as that.
ah, your right, for some reason its working now when earlier it wasnt
I have noticed a bug with the animation clip preview window in previous versions of Unity 6 and it persists in the current version (12.f1) When I press "others.." to search for models to test, sometimes the search popup does not open, it only works once, and to get it working again, you have to press Auto or UnityModel.
and about Muse Animation, it is not yet compatible with unity 6. It tells me something about 2023.2, but Unity 6 is not 2023?
I went to bed, i didnt see any answers so ill just reply :)
pls go check this out i need help lmao
nevermind i chatgpted it, tinkered a lil and got it working :)
Could you do this with animation speed? E.g. pass in a character's movement speed, and the faster they're moving, the faster the animation plays
Yes, but it's not related to properties
If you select an animation state, you can see an option for setting an animation parameter to control the state's speed
Parameters can be set from code in turn
i see
im having a problem where if the player crouches while idle, they stay in crouch even if they let go of control, and the only way to uncrouch is to walk and press control. Attached is a screenshot of my animator, and a pastebin with my movement state manager, my movementbasestate, and my idle and crouch state scripts. https://pastebin.com/78VHaC2z
lmk if theres anything else i can show, thx
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
You don't actually show the conditions for the transitions out of crouching
oh sry i fixed it a lil bit ago
i forgot how but i did
im having new problems now LMAO
im having a small problem getting this wheelchair to tilt back and just balance there
is there a different way to do it? should it be an animation?
just rotating the frame makes it drop down again since gravity
rotating the entire mesh moves it under the ground
im really not used to animating inside unity
When to use animation vs using timeline?
Hey, I'm having an issue with my 3D character rig in Unity. I've tried to fix it, but the problem persists. It gets into a weird pose whenever I go into play mode. (I´m using Animation rigging for the ik solution)
Also is there a way to smoothly transition everthing in the scene into a Timeline playing?
my running animation doesnt work
say i have like 5 or 6 switches (like light switches) on an object that can move independently. should they be separate game objects?
if they're all part of the same object, i'm not sure if i can animate them in such a way that they can move independently
Is there such thing as a 'Driver' in Unity. In Blender, i can set up a driver that causes one bone to do something, based on the rotation of another bone. anything like that built in to Unity? I have a script to accomplish it, but it is not 'inside' the other tools, such as editable like animation. but i would prefer a built in tool
That's the usual method.
What do you mean by 'inside?'
it is not inline with other tools. it is not a thing that i can manipulate from within an animation editor, etc. i should probably just delete that part from the question, as it deters from it, and it not really relevant
thanks!
You can control scripts from the animation editor... though have you looked into the built in constraint scripts? There are a few and they might be able to do what you need.
Oh, nice! No, i was not aware of the Constraint scripts.. I do not know how i missed them. Look into it now, thank you
ok i slept so im gonna try to be more specific with my problem. I put in rigs so that the player's head and body looks towards where they are aiming, but this broke the crouching animation. now the player doesnt go down. i showed all the components of the relavant stuff in the video. im not sure what else i could show to help but if anyone could help me that would be great :)
In the Unity Learn tutorial, walking animations are done with a blend tree that takes x and y direction.
Since none of the properties are actually blended, wouldn't it be better to just script in up/down/left/right states and pick an animation based on that state variable?
Even if blend trees don't do any blending, they still have the benefit of syncing animations and sharing animation transitions
And once the state is playing you can use just one or two parameters to switch between many animations
i see i see, ty
i’m trying to animate a prefab using a sprite sheet i cut with unity. however, when i create a new animation, i cannot drag in the sprites i created to the animation window. is there a way or better way to do this?
Dragging sprites into the animation timeline is merely a shortcut for replacing the sprite reference of the animated object's sprite renderer
Doing it that way doesn't force you to verify that you have the correct object with the sprite renderer component for overriding its sprite reference, so it's more prone to user error
so what’s the better way to animate prefabs?
Enable recording mode and change the sprite reference directly
thank you
I'd have said it is a feature they added because it looks cool when showing off your features even if it is impractical =p
my bsse character looks like this
and im trying to make it so when the walk anim plays his arm stays out so i applied a Avatar mask that looks like this ... then i applied the mask here ... but when the animation plays it looks like this. Can someone help me out
Is there a way to ragdoll only certain limbs of an animated character?
why is my animation different at the looping point?
- it uses more bone weights than your graphics settings allow for
- keyframes have been simplified too much on import
- it's a Rigify rig which doesn't support exporting because it relies on bone constraints
Do you guys have any advice on how to make sure that animations and other effects stay in sync with the music for the entire demo? (demoscene)
I'm currently making a demo in Unity, and I'm creating some dance animations for it in Blender
Use Timeline?
i have an animation that simply moves an object down a little bit
it's supposed to move down relative to wherever it already is, but the animation overwrites the object's transform
what am i doing wrong?
oh... i fixed it by clicking the "apply root motion" option in the animator component...
but i didn't need that option for other objects...
no its a humainoid so i cant even make one in the editor so i just positioned the hand how i wanted it with the bones
now i have the problem that if it starts in the "down" state, since i have it skip the animation, it doesn't appear at the right location
i have transition offset = 1... this should skip to the end of the "moving down" animation
but it doesn't
maybe i'm going about this wrong
i keep getting this error
nvm i got it to import into blender
Good
Im good at blendee
If u need help feel free to dm me
nvm it was my settings ig
i imported a sprite but it doesnt match the hitbox, any way to edit the sprite so its a bit to the left and operations like that? should be relatively easy
how did u make the arm out like that im having so much trouble
okay that wasn't really the right fix, i needed to make it part of a parent object so that the motion of the animation was relative to the parent
@cunning magnet all animations are relative to their parent, and reset to their original position on loop unless root motion is enabled.
what if it's not looping?
it's a switch so it should just move and then stay in the new position
oh my god it works!
can anyone help me with my unity animation. im having a bug
Best to just describe what you need and ask the question.
Good luck
Then turn off looping
oh i didn't see that setting but i'm working on something else atm
i may need that setting later
https://sketchfab.com/3d-models/cartoon-rigged-fox-2457464863604b7187ab87f6571d5131
I recently purchased this model but when i try animate it in blender it does this:https://drive.google.com/drive/folders/17OZNDa0erUUIYB1FWAjKwl7OjM21keHD?usp=drive_link
When i move one bone the movement is mirrored on the other. I dont know how to get past this. I hope there are some blender experts out there who might now whats going on.
Fox Modeling :
Fox Rigging :
https://youtu.be/5-qVNEKEDJs - Cartoon Rigged Fox - Buy Royalty Free 3D model by Starkosha
I have a script I downloaded that has a custom editor that controls how all the values are set to the script. However this custom editor doesnt support Unity Animator keyframe capture, how can I edit the script to support it?
The problem im having is that when I edit stuff in Animation preview record mode, nothing is captured to keyframes to then playback
https://assetstore.unity.com/packages/tools/modeling/splinemesh-104989
This is the script I am working with, it has no keyframe support as far as I can tell
The vast majority of scripts support keyframes by default' you should be able to key most serialized values
hello
question
i need ( want) to use inverse Kinematics to animate a mech leg that is triple jointed, howerver i cannot have some of the joints to rotate around ... non desired axis
is there a way to limit the rotation angle / axis of a bone and still have it somewhat responsive while using the animation rigging package ? or are other solutions like FinalIK the only way to do something like this ?
Hey! I'm using a two-bone ik constraint for the left foot, and I'm using a multi-parent for the hips. How do I move the target of the L.Foot because it's just now stuck?
Animation rigging package should be fine
then is there a way to limit bone rotation ? i know rotation constraint exists but it doesnt get me the results i want
and it doesnt work properly with chain IK constraint
Twist chain I think?
that does not do what i need it to do
as it only works in rotations
and i need both position and rotation
and it doesnt limit bone rotations
it is not the right tool for this
Well, you can see the options here 🤷♂️https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.1/manual/ConstraintComponents.html
i'll attempt the multi rotation constraint
but for now this is not looking good
bit of an animation noob, I'm messing about with my jump/fall blend tree and I have 6 frames in the whole jump (3 up, 3 down), and the 1st and last animations are playing fine but the middle 4 frames are playing too fast, do I need to fiddle with their thresholds or anim speed in the Blend Tree or have I just completely overlooked something obvious? I've tried setting the thresholds from between 1 to -1, these were my current values, just not sure what I did
Works fine otherwise, I just need the animation of the middle sprites to be longer, I guess?
nvm I give up
All animation clips in a blend should be the same length, ideally
I purchased UMotionPro to try to be able to get some Humanoid Animation editing done in Unity. Now i see an asset called Very Animation. can UMotionPro do what VA does, or do i need to get VA?
So I am a noob to animation in Unity, i am trying to learn it a bit by using a free asset off the store. The thing that confuses me, and I dont know if its the asset itself or I am doing something wrong, is that the asset has all of it is animations in individual animation controllers. This seems wrong from what I understand but maybe its just a different workflow?
Most likely for ease of showing off the asset content more than for use in a game directly.
hey i need a bit of help in this dumb problem:
why i cant select the bones of my character :(
i used to move it whit any problem
but when i come back to make a crounch animation the bones get unselected
how long does a Trigger parameter stays on ?
i thought it was for precise control of a transition, so i made state a and b transitioning to each other using the same trigger
but if im in A and trigger the Trigger it can go back to A after B
Anyone know how i can make my own version of AnimationUtility.SetKeyLeftTangentMode that works at runtime?
Or how i could check what the code in "SetKeyLeftTangentMode_Injected" is doing
Hi guys, how u doing ?
I'm using Synty Characters for my game. As i use mixamo animations, i need to use avatar to make my animations work. Nevertheless, i'm also using animation rigging package to make my own animations. But, now, as i use an avatar on my animator, i can't reference my rig anymore. Does anyone have a solution?
Ome frame, generally.
I am thinking about my character creation system. I want to be able to Scale a bone without scaling it's children. My go-to guy (CGPT) says the way to do this is with scripts. In Unreal, i could set these things graphically in an AnimGraph, similar concept though. scale one up, while scaling the other down. at this point, i am considering a Singleton and event driven inverse scale application to child bones. in this idea though, i would have to add a script to each bone that i would make available for player controlled scaling. thinking back to how i did it in UE, it is probably right about the same, except it gave the illusion that i was making one script and magic was happening. i am still working on getting used to having to put a script, of the same type, on 40 different bones. In the end though, it would have just been the same thing with nodes in UE, so purely psychological. Well, that is, unless this is just a backwards concept and i am missing something
i have mp option to set up a grass texture
Guys, I have this script here ( https://hastebin.com/share/igeyiyutej.csharp) and 2 animations for a window that opens with the scene and close when the player close it, but the animations are not working, I just want to the animationIn open the window and when the player close it the animationOut plays, I tested all methods from internet but none of them worked, can someone help me?
my character's moving animation start is delayed, and when it finishes, they briefly look up
the animation transition is a boolean (_direction != Vector2.zero)
also the walking direction is a blendtree
So you need to make sure the blend direction only changes when it should.
Sorry not exactly sure if this is the correct channel, but I have a 3D model blender Armature problem. The armatures work fine in Blender, but when interacted with in Unity it doesn't work as expected.
Why are you using armature btw? Instead of skinned mesh, one composed of multiple objects seems more suitable to me. If you wanted to rotate the bar (and the wheel and stuff) along the local Y axis, you should have a parent object that has the same rotation as the bar and the bar should then have (0, 0, 0) rotation relative to the parent. When you rotate the children then along the Y axis, it should rotate in the right way. There might be an easier way too but that's what I think should work atleast
I asked what method I should use in the Blender discord and I was recommended armatures. 🤷 I wanted to just set the wheel bars and the wheel as a child of the handlebars and just rotate the parent, but the handlebars and the wheel bars are connected to the bike frame on a weird angle so I'd have to rotate them in the y, x AND z in a specifc manner so they don't just "fly" off the frame
And I have never heard of skinned mesh, no clue how that would work
Oh ok, so it runs the blendtree a frame after the switch trigger
skinned mesh in unity = armature in blender
As I said, I think you would want to use empty parent for the bars and rotate that to correct angle so that you only need to rotate the handlebars along one axis
@west orchid also because you use armature, you will get these weird rotations to begin with which are quite suboptimal for use in unity . you can change the rotation in blender too but I don't see a reason to use armatures to begin with. Afaik armatures should only be used for objects such as characters that need to be bend and not just translated
In blender context what they suggested in the blender discord is totally fine but I wouldn't do that for models that you export to unity
Rotating along the Y axis and the Z axis have the same problems. I'm not sure what I'm doing wrong, or if the result I want is even possible with my bike
I'd suggest using the Local mode (top left corner of the scene view) to see the axes properly
I think you should have another empty object under the GameObject (with 0 rotation) that holds all the individual parts
this is my bike set up where BarParent is rotated and FrontPart is not. When I rotate FrontPart along the Y axis (Z in your case), it rotates correctly. The second image shows the FrontPart is selected and you can see that the Local axes are also aligned with the correct axis. In your case I recommend making the FrontPart object an invisible parent as well instead of some of the parts because likely their origins doesn't align with the correct axis unlike in my case
this is damn bugging me, why does the blendtree run before transitios
Again, you cannot rotate the already rotated parent itself, you need to rotate the unrotated child which then can contain all the individual parts
But to rotate the handlebar and the other parts correctly, I need to rotate not only the Z axis, but the Y and X axis precisely. I just don't understand why the Blender to Unity armature/bones is so trash, at least in my case.
Do this: 1. Rotate GameObject to (-22, 0, 0) 2. Create an empty object that's child of GameObject and make it's position and rotation 0 in the inspector (no rotation relative to the parent), lets call that GameObject2 3. put all the parts you need to rotate under GameObject2 and rotate GameObject2 along the Y axis, that's all you should need to do
The reason this is bit hard and different from blender is because the rotation you see in the inspector is relative to the parent so rotating them won't rotate along the local axes of the object but instead rotates along the local axes of the parent. You could rotate along the local axes via code but if you want to have any control over the rotations in the editor, this parenting trick might be useful
gasp
That actually worked. There's still a slight deviation ( when the gameobject2 is rotated you can sort of see the handlebar move off center as it rotates) but it's not THAT bad.
Thank you so much XD
I'm so sorry for being annoying/misunderstanding your messages, I've just been dealing with this problem for over a day. I should have slept and started fresh in the morning, but I decided to pull an all nighter and I'm crabby lol
All good. Just recently had to figure this out myself and got confused many times myself on the way
Yeah, I wish it didn't have to be so complicated lmao. You'd think importing armatures from blender would work seamlessly XD
By moving GameObject2 slightly you might be able to fix the off center issue (assuming I understood correctly what you meant by that)
the position of GameObject2 shouldn't affect the rotations so changing it should be fine although the objects under it will move too so you may want to unparent them, move GameObject2 and parent them again
Yeah I'm just going to have to figure out by how much. If I care that much about it.
I'll figure something out in code, when it comes to scripting I can handle things, for the past hour I've been debating on whether I should just find the ratio at which the X and Y rotations rotate with the Z for all the objects, and changing the rotations and positions using those ratios via script, but thank god you found this solution lol
It also looks like the rotation of -22 might not be exactly the right one. What I did was to do the parenting stuff in blender so I got everything centered and in the right angles
This fixed them flicking up, but they still wait a bit before starting the animation after moving
Exit time is off
This happens before and after actually
Blendtree isn't triggered, it is always evaluated.
my main worry was why it was transitions was done after the frame animation but i managed to fix it
now they just hover on their last state for a frame or two before changing
i've tried switching to transitioning from any state
it still does it
this is aggravating
everything online is about "has exit time"
that was the first thing i checked
haha it got MORE confusing and annoying!
parameters don't update on the animator view!
but the animation still changes
they're behaving as if they still have exit time
is possibly because they're finishing their current frame before moving to the next animation
how do i fix that?
do i upscale to 60fps with 15 frame intervals
or is there a better way
nope, it's already at 100fps with 25 frame intervals
Does the transition have duration?
There is
this fixed it tysm
Hey, is there a way to suppress events from state A the one being transitioning to B?
I have a situation when using crossfade that if i time it properly i can fire event AnimationEnd at state A, and skill B will use this event as its own
The event could include a check for what parameters or states are set/active before running other methods in it
Im using script like animator listener for the events
hmm so i should check in it if the event is valid
As far as I know the event of a state fires if it has >0% blend or it does not, but there isn't a way to suppress it in any particular way
So you'd rather check for the current animation state or other variables
You could also have another event at the beginning of the next state that sets a variable informing that the previous state's event should be ignored
State machine behaviours https://docs.unity3d.com/ScriptReference/StateMachineBehaviour.html are also useful for adding more complex rules to individual animation states
got a question about the particle effects system
i want to create a particle that follows the player and bases itself off the player's current sprite while its being animated
basically a sprite trail like this
how would i best be able to achieve this using the particle system, or would i need to write my own system for it
You could make a script that reads the character's sprite renderer's sprite reference at the frequency of the trail and stores them in an array that's the length of the trail
Then you'd have equally as many sprite renderers, or particles using the Texture Sheet Animation module for rendering them
Then at the same frequency have the sprite renderers or particles trail the player character
Can you animate a 2D Tile in the same way you'd animate a 2D GameObject? With a controller and stuff?
Not quite
Look at the Tilemap Extras package for an animated tile sample
Yeah, it seems to just be a simple animation loop
Well I can make it a GameObject, no biggie
Anyone have any concept or ideas how they would do pack animations? for tcgs? Just looking to get some ideas or concepts.
I have an animation clip that is 12 frames long (looping). When I preview it on the GO using the "Animation" tab, it looks great. When I put an Animation Controller on the same GO and play it, it loops but freezes for 12 frames every cycle.. I'm new to animations, anyone know what I'm doing wrong?
animation jitters for some reason when imported
"loop time" is not enabled on the clip
Hm.. OK, I just enabled that but .. no effect?
Should I be using a move -> move transition?
Are you sure you have only one "Move" animation clip?
You can double click a state inside the animator to select the exact asset
yeah - I think I have it working but.. it's not what I expected it to be? I unchecked loop on the move animation clip, but then set all the exit times to the length of the clips with no transition times
I have a "move in" clip
I wasn't really understanding the transition pane but I think I do now.. the top bar is the "from" clip and the bottom is the "to" clip (this clip)
This is only necessary if you want to restart an animation before it's complete
I dunno if I'm doing this right, but I was thinking I'd control this all from code via triggers - so MoveStart plays the "move in" clip which immediately transitions to "move" which loops to itself
"MoveEnd" trigger immediately plays "move in" (speed -1) and then goes to idle
I'm not sure if that's... the usual way?
Looks like you have some dead space in the move clip which is you end up having to restart it with a transition
Rather than letting it loop naturally
Otherwise that sounds okay
It's a little hard to see in the video capture but the "move in" transitions from the idle stance (legs apart) to the running stance
it looks ok on my side.. I could probably slow it way down using the speed parameter to double check? but for now this is just prototypey sort of work, just .. finding my way around living life in 3d
I'm a 2d nerd
Is there a way to set a UI horizontal layout 200 pixels away from the scene/camera border at this resolution?
I have uploaded my model on mixamo and then exported an animation with it. Now when I use the animation on my enemy prefab's root animation controller, it shows that components are missing
The animator expects to be above the Root because it's looking for a transform named "Root" under it
but i have added animator to the root, so what do i do now
Remove them and and add them again to the one above
You can right click to "copy component" and then click the three dots to "paste as new component"
i actually want it to be in root only
because my other animations depend upon being on Root, only 1 animation which I imported from mixamo is causing issue
You can rename animated properties to change the path, should be able to double click the string highlighted in yellow
nothing happens when i double click
on the property
Alternatively you should be able to click it and hit F2
didnt work
It's a bit finicky, you can only rename property paths that are not on the root of the animator
(which your Root : whatever property paths are not)
Anyway, since there's so many property paths it may be better to just use an external editor like notepad++ that has operations to change all the relevant lines at once on the asset directly
how to change the property paths
Do i have to change something here?
No
What you're doing now has nothing to do with root motion
The animation clip is just looking for animated properties under a gameobject by the name of "Root"
In my example here the gameobject is "Cylinder"
okay that i understand
but im unable to rename
I see read-only in brackets next to my animation names
That means they cannot be edited because they exist inside your imported mesh asset
You can duplicate the animation asset with ctrl + D in project window to create an editable copy
yeah i did ctrl + D still cant rename the properties
Probably because you didn't assign the newly duplicated animation into the character's animator to replace the read-only one
no no, i did that. Its not read only anymore. And I have replaced in the animator as well
But still cant change property name
Not sure why not
You could try to edit the asset manually
The process looks like this
how to access these
You'd have to open the animation asset in an external editor
.anim
it kinda looks like this
so i need to find path
then manually set the names as they are named on the gameobject
in my notepad paths are empty lol
but how would I know which gameObject name to write in which specific path?
Hi guys, I have this orange window and this to animations (in and out) the idea is that when the screen is loaded the entry animation happens and the window remains until the player taps the close button so that the exit animation happens. I can't get these animations to work in any way, the more I try to fix the worse it gets, can anyone help? I've already checked the scripts and parameters, but nothing works.
i want my model to hold a sword but the sword wont be in the model file, only the animation
(since the character can also use different weapons, having sword on the model file would be bad)
how can i do that?
i am thinking of adding a bone without weights to my player rig
i will use it as the optional bone, for weapons
but i am kinda lost, and don't have much experience with animations
my rig is generic and the animations are seperate files by the way
so adding another bone without weight (probably) wouldnt cause a problem
This is a good common solution
thanks, i wasnt sure if it was a terrible or a good idea. ill do that
In my experience the only drawback is that if you don't clearly know how many item bones you need and what the animations will be using them for, it can become tedious to make changes later
probably 1 or 2 would be enough
but i think i'll make 4 to make sure
since there is only a single player character
and the bones are probably just transform components
without a weight
i think it would be fine
Also, some of them you might want to parent to the character's hand, some to some other body part like hip, or maybe just the root
Constraints can be used to change parent at runtime, but that can increase the complexity a bunch if you're juggling a lot of items
are constraints blender features?
do they just key the bone to match the characters hand movement
without actually needing to parent them
if so that would be great
Blender has its own constraints, but they are different because they are baked into the animation
Unity's constraints take effect at runtime
do you mean animation rigging?
i should look into blenders constraints
baking would probably be helpful too
That package has the best selection and works great with animators, but there are vanilla variety constraints too
Blender constraints are great for animating
But when dealing with item slot bones you may find you need runtime constraints to keep them stable
Or might not need, depends
If you have a bone at the root, and then attaching it to a bone with a blender constraint keeps it it stable in blender, but after exporting there will be drift between the bone and the hand due to inaccuracy
thanks for the help
i use runtime constraints for more interactive animations
i'll use baked for the non-interactive ones
Has anybody used Confiurable jointss an know why this happens? it looks like its not attached even tho it is
@rain obsidian sorry for ping. did you mean like this?
the rig seems nice
weird
collider positions were looking fine
on this
ill try checking my old project
2 YEARS
Ill try to make a new model to see if there is a problem in the Weight painting
sorry i have no idea what is going on with the arm
Me neither lol there is no tutorials on Mesh Ragdolls. mby i need to make one?
if you made one that would be great
there are only like 10 minute videos
that all say the same thing
at least thats how it was when i was trying to make one
Ye i noticed that when i started
There is still only like one that acctually works
trying to make the bones have correct min-max rotation limits was the worst part for me
i wonder how the devs of fall guys do it
i wanted to make a physics-based walk
like making the character walk from the friction between feet and the ground
but gameplay-wise it was terrible
Its soo hard to learn if you dont know what to do.
Im currently making a Phyiscs game thats a mix of MonsterHunter and GangBeast
But im 2month in an barely know what target lerp do
YE, i have a full fletched plan and i thougth the Character bit would only take 1 WEEEk lol
i think i worked on it for a month just to make it walk too
there are no resources
i used the first month trying to find out how to do it with Target model
But then This happend
so im only using script now to make the animation
for some reason I cant place sprites into the animation window. when I drag the sprites to scene, it does create an animator and animation with the sprites in it, but the animation UI is unplayable and does not play in the game. Anyone know what is going on. I am sure its something stupid
maybe you can try rotating the root bone
but than it wouldnt be entirely physics based
Ye
i tried it
but i think the mesh is offseted
or smth
so it rotates the other way
Do You have a screen shot?
because you shouldnt drag a Sprite into the animator
only ainmation
i think this was what i made
i have no idea what is going on but i can send u project files
if it is going to be helpful
Yes please everything helps
uploading it rn
might include terrible coding
Couldnt be worse than mine
when i opened the project and pressed w
the cameras z position became infinite for some reason
Lol
Thanks
I'm looking for a "best practice" when it comes to melee movesets.
I'm making a yakuza/bully-like game and want to achieve two things.
First of all, how do I make a combo seamless?
For example, if I take two different punches from mixamo and play them one after another, there's this weird "recovery" animation after the first punch (going back to fightting stance/guard).
What's the best way to solve this? Should I just make the second animation to start at the same pose the first one ends (when fist makes contact with an enemy)?
Or should I blend them via the animation controller?
And also (and I apologize beforehand if this is not the correct place to ask this) what's the usual way studios create these replacable movesets?
For example, Yakuza series is know for asset reusing and they always reuse whole movesets.
Does anyone know how these replacable movesets work in Yakuza?
I would like to create an entity moveset, which could be switched out easily. Are scriptable objects the way to go?
I'm just looking for general best practices/tips although functioning code which I could study would be cool.
Thanks in advance.
my animations are jittery when i import them and i dont know how to fix that
usually id just animate them all together, split them and then make the seperate ones hold their pose for a sec before going to idle
I have not seen this before but it looks like there was an effort to change the animation's frame rate to a slower one by duplicating its keyframes, which after being baked, compressed and simplified on export/import now exhibit a wobbly effect when the animation tries to hold a pose over multiple inaccurate frames
yea i have lerp off in blender and i have it at a higher framerate just so making higher fps animations in the future isnt annoying
well it looks better but is there a way to still get the choppy motion i want?
probably because of the low framerate of the animation
i think unity lerps the bones between frames instead of playing them frame by frame for some reason
there has to be a way to disable it, but i dont know how
crap.
I never found a good way
If you export with no inbetweens at all and then change interpolation to constant in Unity, that may work
But you'd have to do it manually a whole bunch and it won't work good with blending
Animator also has the "animate physics" setting which only updates the animator in each physics timestep
If you don't happen to rely on physics much you can increase the physics timestep for a choppy feel
But rather than that it'd be sweet to set it to use a custom timestep instead and keep physics as they are
how do i change interpolation to constant in unity?
By editing each clip's keyframes in the animation window
its read only for me
If I have states idle, walking, attacking, defending, etc. and for each of these states I have different spritesheets for up down left right should I use sub-state machine? or blend-trees?
I have blend-tree working nicely but it seems it wasn't originally intended to simply choose an animation based on a parameter. So wondering if sub state is more ideal for this.
Idk much about animation in unity, but have you put some event outside of animation threshold?
I am having issues with trying to avoid my character from walking at slow speed (as seen in the video). My transition is based on the agent velocity, with a threshold to 0.1. When increasing the transition threshold (to like 0.5), the character stops earlier, but then it slides when beginning to move. Is there an elegant way to fix that?
That's because the animation exists inside the mesh asset
You can duplicate the animation asset to make it not so
how can i make it so that when the shoot and empty clips are played the transform is controlled but only then and when the idle clip is playing i dont want the animator to controll the transform at all, if the idle clip is palying i want the transform to be controlled be a different script i have. I tried removing all the keyframes in the idle clip but that still stops the script I have from changing the objects transform
You should be able to override the animator's overrides to transforms with a method in LateUpdate, or with constraints
thank you, late update works but now its constantly overriding the animator. I basically have a configurable joint to allow the top thing to slide back and forth but it sometimes has autism so Im using a script to copy the position oif the actuall slider while clamping the position so the visible part of the slider doesnt dance arround and that happens every frame, can I check what clip is being played by the animator and only do it in the late update when the idle animation clip is playing ?
I think you can
You can add a statemachine behaviour script to the idle state
oh man thats how you make a statemachine ai, I might have to rewrite all my enemie logic after this
Hey everyone! I wanted to animate the Glassbody and the Veins with the same animator (they are seperate game objects) but in game mode only one of them reacts to the blend tree. Do you have any ideas what the problem might be? 🙏 Thank you in advance!!
They both have the same animator controller and your scripts are setting both their parameters at the same time?
They won't necessary need both an animator, you could alternatively have a script that loops through all the bones of the secondary skinned mesh and matches the transform with that of corresponding primary mesh bones
I'm new to programming so i hoped i could avoid it but i'll try that out :)! Thank you for the quick reply 🙏
How is this animation looking so far? Still very early blocking out stages, but feedback would be great.
Kinda hard to tell what is happening there... is the plane sinking the buildings in the bg, or tilting the foreground floor towards the camera?
The plane is going to be shot down ive just not added the projectile. When the character lands on the switch after the leap, the buildings are going to sink and trees will sprout switching the scene from scifi to fantasy
I feel like all the motions are good, though the timing of the crash and the jump make them feel a bit more connected than maybe you meant them to?
Changing the color of the background or character might make it easier to tell what’s going on during development, even if the final textures are nothing like it
Love the animation though
Don't forget 2 and 3 of what I said.
#💻┃unity-talk message
Edit:
Ah, by words I meant written words, not spoken in the video
Oké so if if i load in the game on my vr i don’t see the lower arms and the hand and i see the sphere controllers but i want to see the hand and the lower arms too does anyone know how to fix that
Here is what i mean
So im getting a character controller up and for some reason only the left and idle animations are playing?
Anyone know why that may be the case?
dm me
ighty
A little progress. I decided against shooting the ship down. Thoughts and/or feedback?
Your else statement only considers the if above it, none else
Wait really?
I thoughts it was like a whole sitch
That explains why only the right works
im assuming using a switch would work out?
You could fix it with else ifs
A switch would probably be more practical
Both of them have the drawback that simultaneous keypresses are ignored by the higher priority keypresses
lemme try out a switch and I'll gets back to ya
If you want movement, rather than reading individual keys it would be much better to read vertical and horizontal input movement axes and set the parameters directly to those
Works better with less work
how would you track for changes within those positions?
What do you mean by "track changes" precisely
They are directional values that get updated by the input manager automatically according to keybinds
https://docs.unity3d.com/ScriptReference/Input.GetAxis.html
https://docs.unity3d.com/ScriptReference/Input.GetAxisRaw.html
GetAxis is smoothed for your convenience (or inconvenience), GetAxisRaw snaps to the destination value of -1, 0 or 1
Question about Unity Timeline : Any idea why the character jump to the initial position between to animations? (for other animations, I just disable Remove Start Offset)
Hey folks, probably an old question but google was not very helpful.
Having issues when importing a blender model/animation into unity. I can basically do it as a baked animation, but Unity doesn't seem to actually recognize the armature or bones themselves.
So if I try to add any new animation (even if its from a copy of the exact same model) it doesn't work.
I've heard Unity wants there to be specific hierarchy/name requirements. Is there a reference online anywhere for that? It's a non-human humanoid model (think like a mermaid or a werewolf)
Animations can disappear if the preview framerate is below 60 in blender at the moment of export
They can also disappear if they are purely bone animations with no mesh included
They can also disappear if the animations are not "pushed down" correctly or whatever it is that NLA editor expects you to do, if you're using NLA editor
If you're using the Action editor the animations must be marked as fake user
But despite that they can disappear if they are too short
or for no reason at all

Unity doesn't care about naming ir hierarchy unless you are using it for a humanoid type rig. That said, to import new animations, you need the names and hierarchy to match between tge objects, and in this case you should probably be using the @ naming to add the animations to the original model.
Thank you both! Do you have a link to some resources for the @ naming? I actually haven't tried that before, btu that sounds very helpful
I never got it to work or to the bottom of why
Importing animations without a mesh alwyas caused the vertex groups or the whole animations to be excluded
Can someone help with this?
That's odd, because Im almost certain the animation had a mesh.
I'll definitely try out some of these things though and try and get it figured out
Easy solution; just export with a mesh. It won't show up in your build so stressing over making it work is probably pointless
That's what I usually do, but did I understand correctly that the point of the @ naming should've been to let you import animations without the meshes
Or does it still add the animations to the primary asset even if the mesh is included with the animation
It should add the animations to the primary asset either way
Is it possible to animate an object in a tile map?
So I reimported my fbx into unity and I added a new animation. For some reason though, the animation I added "3i_Light" shows up in the import setting but not in the project file viewer. When I try to click on what is supposed to be "3i_Light" it ends up highlighting two of the same animation "3i_land"
Its like my light attack animation got overwritten by the land animation or something. Honestly I was going to search through the internet to figure this out but idek what I would search.
What does it look like if you put Project to list view instead of icons
When clicking on it, they both get selected.
I'd try to rearrange them in the import list, maybe change the durations around a bit and apply
Just in case that'd jolt it out of its bugged state
I did try to rearrange them a little, and the two animations are from separate sources. I can try it again and mess with the durations tho.
If all else fails I guess you can duplicate them out into their own assets with ctrl + D
only seems to dupe the land animation lol
Even if doing so from the "separate source"?
I hope I didnt screw up the import, putting all that frame data into the import settings is such a chore
????????? okay duping it worked
I misunderstood, thought u meant duplicate it from the file viewer
Thanks!
Btw is there an easier way to import fbx files into unity? Putting the animation durations and stuff into the import setting manually is the only way I know how atm.
or is that what the reimport option is for?
Is there a simpler or more optimized way to apply an animation to mesh without the need to build animators and animation controllers? I have a procedurally generated enemy that has a segmented body, and each segment has a couple of legs. I need to play one single animation on each of those segments and all control I want is the speed of the animation. Putting a whole animator on each segment sounds wasteful and inefficient, but one animator on the parent of the segments doesn't animates them either.
Simpler or a bit more optimized: Animation component or moving the legs from the same script that manages the segments
Likely a lot more optimized but less simple: Playables API, vertex animation textures, Burst, Jobs
Hey guys I got some questions if anyone can help about animations and blender / importing to unity
Same:(
At least ya got ur anim in unity
nah thats blender
mine just looks weird
I need to start again
At least my rig and model work
I made him myself
no but thats a good idea
Lmao
So get a frame by frame pic
And I think that's it make the poses move the key frames etc
Any idea that when i flip the character, it flips at normal position but when i flip the weapon, its flipped at the further position?
My usual suggestion is to start with the hips
Because it is flipping around its center?
ive made it center but still not working
Does anyone happen to know a way in a "StateMachineBehaviour" script to run a function every new animationframe not updateframe, like when a sprite changes run a function?
Happy update re: my animations not importing! Turns out to have been an issue with my root note, which for some reason was imported differently, despite being the same model. I imagine I must have exported the second model incorrectly from Blender. When I re-pathed my root on my other file to match my original, it works great now.
So if anyone else is having a similar issue, just make sure that the "root node" property of both files is identical. Feel kind of embarrassed I didn't figure this out sooner, but I'm glad it didn't require a more complex fix!
I need help with getting animator to work so pretty much I downloaded a asset from unity store I know how to make a fully move able character but issue is I don't know where to start when it comes to animations at all and I humbly request any suggestions as I'm a student trying to learn unity
I followed all of unity essentials tutorial but I don't know what to do next
I'm interested in 3D modeling mostly
its fixed now they transition almost perfectly
I would suggest do the Scene in Blender since its free and import it as a blend file to Unity
there are plenty of tutorials on youtube and Udemy , sorry Im dont know much but maybe thats a start of search
You deserve the world for the kind advice
Hey! Just wondering if anyone has any sort of explanation as to how anim clips are actually handled? as you can see this animclip has keyframes for 5 sprites, and I am trying to in a "StateMachineBehaviour" call a function whenever a new sprite or keyframe is reached. Unfortunately my animclip has 34 "frames"? From beginning to end which doesn't seem to have any correlation to the amound of sprites actually being rendered at all. Any help or insight would be greatly appreciated as I've been stuck on this for a little while now.
You can use animation events for this, but it may not be the best way depending on what you are doing.
Oh, sorry I forgot to mention I cannot use animation events. I must use a "StateMachineBehaviour"!
If I can't directly determine when a sprite is changed through the animclip I understand, but if I could just understand why my animclip's sprite changes are so spaced out by default and fix that automatically in some way to accurately match my total frame count to sprite changes then I can determine using framerate what sprite I am on accurately.
Also by default, I've noticed it forces an extra frame if that is possible to remove that would be very helpful!
Why don’t you just get the sprite directly?
Yeah, I could do that but it feels a little hacky I'm worried things could break or slow down if I am passing in realtime sprite changes to my StateMachineBehaviour, and running functions based on that data. Essentially my StateMachineBehaviour loopsthrough the player's current held weapon's "AttackComponents" and checks if on that current frame there is an AttackComponent to "invoke", these attack components will play sounds, move the player, create projectiles, etc.
Oh, if you’re doing an attack on X frame I wouldn’t advise using animation. I have a similar thing in my project, but I have the script determine progress the animation rather than having the script read data amount the current animation.
How can I arrange these animations?
- Start walk left
- Start walk right
- Walk forward
- Stop walk left
- Stop walk right
Left - right represents the foot of the character
I would say blend tree
Not necessarily doing an attack on "X" frame, essentially my player is using a statemachine which calls from whatever state is set for example "left-mouse-attack" would call for the left hand's animator which is set when the item is equipped, then it would play "attack-left-1" as an animclip. Obviously this was simplified but that's the general idea.
By state machine do you mean the design pattern or the unity animation thing?
design pattern, not an actual Unity "StateMachine"
Then the weapon type stores a base "animator controller" which is overridden by a specific type of that weapon, and the base animator controller has the "StateMachineBehaviour" that I am working with now.
Ah. Then defiantly track and increment the current frame based on the script and force set the animator to comply with it.
And this (since it's on all weapons) will loop through the current weapon's data to determine if a projectile should fire based on the frame of animation
Yeah, that seems like a good plan. I'm not exactly too sure how that would be done necessarily.
Which one? 2D? 1D? How should I blend them?
But yeah, this is how weapon data is laid out in my weapon scriptableobjects, essentially it has a slot for an animatorcontroller and will dynamically populate attacks and frame data which you then can add "Attack Components" to which are played on that frame.
Freeform directional has a better blend
This is an example, but this would play a "MovementData" on Attack 1->Frame 1
when using this specific weapon
I have a int representing the current frame in the state class, and whenever the state logic updates, increment the current frame. Then you can go in your dictionary or list or whatever to check the events on the current frame.
But it's for something where we have directional animations like strafe left and right
This is only one walking animation
which "state" class is this stored, the StateBehaviour? Or like player state
Like "idle" or whatever.
The player state
Left and right means animations starting from left foot or right foot
so , is it only left, right , forwards or do you want to go like left + forward
If you made that an interface you may have to change it to an abstract class
The issue with not using an animator controller is I would need to hardcode every single weapon type, with an animator controller I can override it dynamically and only use what I need. I don't think that'd work in this case.
so it goes diagonally
But I could be not understanding perfectly.
Eh? Why would you need to hardcode it?
You can make states check the players’ current weapon.
you can have one animators for all guns and only just layers I think ?
True, I'm sorry just trying to visualize it atm. Give me a sec
No, I'm not achieving that. Ik you're talking about putting animations on x axis -1 to 1 and on y axis also. But no it's not that.
I'm trying to make a smooth blend of animation, so I break down the walking forward animation into idle to walk and walk to idle.
Okay so I think I've got an idea, I could just move the logic for my "frame update" to my state and leave all the animation incrementing to the animation and just check for sprite changes in the state and invoke anything I need to from there.
Here is some pseudo code:
class AttackState : PlayerState
{
int currentFrame = 0;
private override void UpdatePlayer(PlayerHandler player)
{
player.CurrentWeapon.StateEventDictionary[currentFrame].CallEvent();
currentFrame++;
}
}```
Sorry for no tabs. On phone
Yeah, I think that works. I'll look into it appreciate the suggestion and tips!
Yeah. Have animation handled separately so it doesn’t depend on the animator.
NP!
Yeah, the issue with not using an animator is if I have like a hundred swords it's a lot easier to dynamically override animclips using an animator override controller and have all the logic stay the same, but I guess if the logic is handled in the state anyway I don't see why not!
I have a similar setup in my game. All moves are scriptable objects with <int, IFrameEvent> dictionaries so I can dynamically invoke logic.
Looking back I actually don't remember at all why I even started using a "StateMachineBehaviour". I probably had a reason, but I'd like to think I was just tired and not thinking properly haha.
Yeah, I like to keep all my custom logic to an inspector visualization, I'm creating an easy-to-use engine for non-programmers to still implement items visually so it makes adding new unique items as fast as possible.
I put it in the inspector too I just use odin lol
Yeah, I really tend to avoid packages/assets since I enjoy the learning curve of figuring out how to do it.
plus it allows me to have full control over the project and tweak anything I'd like to without worrying about dependencies or anything that might just dissolve my project somehow.
so Im making an the FPS animation and im only using the arms and gun and Unity automatically assigned them to the legs :/
So if a frame gets skipped what happens?
the idea is a frame doesn't get skipped. But in that case the attack's ability on that frame likely wouldn't fire.
But I'll likely ensure it can't be skipped in the future either way, just trying to get a proof of concept done atm.
Unity animations actually have no concept of frames when it comes to the actual data. It is all based on time. The length of a frame is based on the animation's sample rate.
That 'extra frame' you mention is not an extra frame but actually the duration of one frame of that keyframe. Without it, the animation would cut that frame off.
The system wasn't designed with sprites in mind.
Ah, I see! Thank you for the explanation, I knew that animations didn't actually have any concept of the sprites inside but I suppose that makes sense having the duration required for the final keyframe to actually play through.
Yeah, that totally makes sense. My entire game's animation/design pipeline is currently being designed to be extremely efficient in terms of cutting down on manual animation tweaking and imports directly from our pixel animation programs, which pretty much have the ability to export whatever I'd like them to, so if I can get a system going where to create an entirely new item I can simply import it's animclips from my design program and have a working playable item that'd be ideal. I definitely need to look further into how everything is actually being handled to determine whether relying on animatorControllers/overrideControllers to "sort" my imported animclips is actually going to be the best path going forward, but I like how clean everything is in the inspector atm.
Hey! Just as an update it worked beautifully. Honestly better than I even hoped, since now I have a direct route to my player gameObject which I can pass directly into my "AttackComponents" so I don't need to worry about any hacky ".Find" solution or anything. Appreciate the help once again, I also discovered the reason for initially using a "StateMachineBehaviour" was so I could call a function disabling the animator after use to save resources, so I guess I got side-tracked and just started to invoke everything from it haha. But yeah, I appreciate the help even indirectly getting me back on track, haha. Have a good one!
public override void LogicUpdate()
{
base.LogicUpdate();
string currentSpriteFrame = player.primaryHand.GetComponent<SpriteRenderer>().sprite.name;
if (currentSpriteFrame != oldSpriteFrame)
{
oldSpriteFrame = currentSpriteFrame;
Debug.Log(currentFrame + " This is the current frame!");
// LOOP THROUGH AND INVOKE ATTACK COMPONENTS ONLY ON SPRITE CHANGE !
foreach (AttackComponent attackComponent in player.primaryItem.attacks[player.currentAttackCount].frames[currentFrame].attackComponents)
{
attackComponent.Invoke(player);
Debug.Log("Invoking: " + attackComponent.ToString());
}
currentFrame++;
}
}
It's super cool to see my conceptualized solution actually work in-game!
