Questions tagged [unity3d-mecanim]

Mecanim is the Unity game engine’s animation tool, which includes retargetable animations, full control of animation weights at runtime, event calling from within the animation playback, sophisticated state machine hierarchies and transitions, blend shapes for facial animations, and more.

Useful links:

25 questions
8
votes
2 answers

Unity Animation Plays In Preview But Not When Playing Game

I made a simple animation for a sword gameobject to constantly slowly move up and down while the player character is standing still. My sword has an Animator component attached: The Animator Controller is also very simple, with this animation…
Blaperile
  • 141
  • 1
  • 1
  • 6
4
votes
1 answer

Retrieve all Animator States and set them manually in code

I've stumbled upon something I never imagined to be a problem but... it is. I am writing a visualiazion/simulation toolkit using unity 5.5. The used model is already imported and animation clips are set via the editor. This is what my animation…
Hafnernuss
  • 2,659
  • 2
  • 29
  • 41
2
votes
1 answer

Mixamo upper body rotation only not working

This is my first question on Stack Overflow so I apologise if anything is not to standard. So I'm a beginner in Unity exploring into intermediate territory. I am learning Unity by doing a third person shooter but throwing items instead of a gun. I…
2
votes
1 answer

Unity Mecanim. How to reset animation before disabling a gameobject

Unity 2019.3.7f1 .. The artist I'm working with has made some animations for some UI stuff using the mecanim system Animator component. I fire the animation with Animator.SetTrigger("ParamaterName") The gameobjects with the animator components,…
Guye Incognito
  • 2,726
  • 6
  • 38
  • 72
2
votes
1 answer

Unity Mecanim - play animation in certain amount of time

Programming RPG game, I would like to control animation speed in relation to its duration. For example, character has to cast spell in X seconds. I would like to play the animation state so fast so the animation is finished exactly in X seconds. -X…
Zedd
  • 167
  • 3
  • 16
2
votes
1 answer

Coupling navigation and animation in unity

So I've implemented this tutorial: https://docs.unity3d.com/Manual/nav-CouplingAnimationAndNavigation.html almost to the letter. Almost means that I'm using the 2d freeform directional blend type instead of the simple directional they are using. The…
Marek M.
  • 3,799
  • 9
  • 43
  • 93
2
votes
1 answer

Unity 3D animation.MatchTarget with root motion affecting only position or only rotation

Background In the Unity 3D engine version 2017.3.1f1, I'm working on a 3D character driven by mecanim root motion. I need to rotate the character exactly 180° around the Y-axis (up) so it then walks left or right (it's 2D game). Because it's…
Filip Pokorny
  • 41
  • 1
  • 6
2
votes
1 answer

How to know end coordinates of animation in Unity?

I want to know coordinates of root bone in the end of animation in Unity. I tried to put unit with Animator controller programmaticaly to the scene, play animation and execute Update() several times. But coordinates are slightly different from the…
Inflight
  • 497
  • 4
  • 12
2
votes
1 answer

How prevent large amount of transitions in unity state machine?

I have a unity state machine with four states: idle left, idle up, idle down and idle right. To transition between these states I had to create 12 transitions. (the white arrows). This already seems unwieldy, but now I need to add 4 more states:…
Kokodoko
  • 26,167
  • 33
  • 120
  • 197
1
vote
1 answer

How to exit a state early from within a StateMachineBehevior?

I have a StateMachineBehaviorScript that needs to check if an external boolean is true or false, and if false the current state needs to stop immediately to let the next state proceed. I have tried using animator.StopPlayBack() if the condition is…
1
vote
1 answer

Unity 5.5.0f3 play animation backwards at runtime

Original question on the Unityforums here I've been trying to get an animation to not only slow down and speed up, but also play backwards depending on user input for my Hololens-application. I am using the Mecanim system, not legacy animations.…
1
vote
0 answers

How do you get possible transitions from the current animation?

I have several trigger animations which start an animation which are divided into three separate states (in, main and out). The animations would ordinarily play like so: Idle (trigger)-> in -> main -> out -> Idle I want to be able to abort the main…
Patrick Klug
  • 14,056
  • 13
  • 71
  • 118
1
vote
1 answer

Swapping animations of mecanim bones

I have written a function to swap the rotations that are applied to mecanim bones; e.g. left and right hands: private void swapLimbsRots(Quaternion[] rotationsArray) { Quaternion bone1Rot = rotationsArray [(int)XsAnimationSegment.LeftHand]; …
user285372
0
votes
1 answer

Set mecanim animation playback time/position

I'm trying to set an animator's playback time. (or, start an animation at a specific time) I haven't had success with either approach. Note: I am setting the Animator (an) in the Start(). Code I've tried: Public Animator an; public void…
Penjimon
  • 469
  • 4
  • 20
0
votes
2 answers

How can I make changes that happen as part of an animation clip permanent?

I want to animate a card flipping from its front face to its back face. Both card faces have different sprites as their background. I have an Animator component attached to my card. The animator rotates the card 180 degrees around the z-axis, and…
Ben Rubin
  • 6,909
  • 7
  • 35
  • 82
1
2