Unity2D: Character goes up and down during idle animation

My character is idling but his feet are changing position during the animation: it seems he’s floating. I would like to have the character with his feet stuck.

Video to visualize the issue: https://vimeo.com/568057364

As you can see, the feet are going up and down. I’ve also tried to animate the collider in order to follow the feet, but that attempt didn’t solve the issue.

Why does Unity show dark regions on a model with animation created using Blender?

I sculpted a model in blender, and I want to import that to Unity. When I import just the model(without animation), Unity shows as is. However, when I attach armature to the body and automatically assign weights to it with the intention of creating an animation, Unity import shows dark regions all over the model. All the face normals look fine. I am not sure what the issue is.

Model in Blender: Model in Blender:

Weights: Weights

Dark patches in Unity: Dark patches in Unity

Enemy Follows the Player Even His Death Animation Triggered

I have a 2D game project and I am coding but still on learning level. If I put simply, its based on player’s escape and enemy follows to hurt him. Important case is, I am using A* PathFinding for this because there are obstacles for enemies and they need to pass them.(A stars pathfinding here: https://arongranberg.com/astar/ )

Problem is: Enemy following Player, wherever he goes on the flat rectangular scene, but when I kill enemy while following, his death animation triggered and he dies in 3 seconds but he still keeps following me while he is dying process going on and even when he is lying down on the ground. Simply flies to me.

What I need is to make him stop at that very location when his "isDead" parameter gets triggered. Because of A* using, I couldn’t find a way to do it and override A* somehow.

This is the code I use for attack when close to player, and isDead function:

public float stopDistance; private float attackTime; private bool isCloseForAttack; public float attackSpeed;  public void Update() {     animator = gameObject.GetComponent<Animator>();      if (player != null && !isDead)     {         if (Vector2.Distance(transform.position, player.position) > stopDistance)         {             animator.SetTrigger("isNotRunning");         }         else         {             animator.SetTrigger("isRunning");             if (Time.time >= attackTime)             {                 StartCoroutine(Attack());                 attackTime = Time.time + timeBetweenAttacks;             }         }     }      IEnumerator Attack()     {         player.GetComponent<Player>().TakeDamage(damage);          Vector2 originalPosition = transform.position;         Vector2 targetPosition = player.position;          float percent = 0;         while (percent <= 1)               percent += Time.deltaTime * attackSpeed;         float formula = (-Mathf.Pow(percent, 2) + percent) * 4;         transform.position = Vector2.Lerp(originalPosition, targetPosition, formula);         animator.SetTrigger("attackMove");          yield return null;      } } } 

Unity animation moves a game object. Should I create all my animations again from the scratch?

Unity animation moves a game object. Should I create all my animations again from the scratch? Or how can I fix the issue?

I recorded approximately 15 animations in Unity. Now I try to animate in place and simultaneously use the physics engine of Unity to move game object. But I found out that the animations actually change position of my game object.

I tried to follow the advice from here:

I came across with the same problem, and I fixed it with parent game object. But, there is a small trick: Create a new game object inside your problematic game object, the new game object gets the parent (0,0,0,) coordinates and this will be the origin coordinates. Then, put the old game object as a child to the new one and make all the positions as you like. Try a few times and you will get there.

But the result was just the same. The game object still changes its position during animation. So, now I am afraid that I will have to start everything over again and do animations once more. Last time it took me two weeks to complete all the animations. So, I am hoping to find another solution, which would help to fix my problem without remaking all the animations.

enter image description here

Prevent Mathematica from playing an animation upon loading

When I load a notebook that I’ve previously saved containing lots of animations, Mathematica will automatically begin playing all of them. (Typically, I’m animating plots, so my code would look something like this:

Animate[Plot[f[x,n],{x,0,1}],{n,0,1}] 

This leads to a lot of lag and it is time-consuming to have to pause them all before I can continue working. Is there an option or method to prevent Mathematica from automatically playing animations when loading a notebook?

I do not understand the code version of time based sprite animation?

I’m Universo and for the longest time had coding issues around the concept of time-based sprite animation basically, do not know how to implement it and any code or explanation simple or complex that I’ve found has been extremely confusing to me and was hoping to have a kind person walk me through the code step by step, explaining exactly how this is implemented correctly.

Here’s what, I believe to know about the concept and or idea for time-based sprite animation it is to construct a delay or halt of some code statement using time of some kind in milliseconds with a collection of moving images and or sprites however any attempts from the tutorial’s or my own brain have resulted in inaccurate various speed sprite animations and not the consistent stable speed, Id appreciate and be grateful for here’s some code to show my progress and perhaps help you understand my position in this mess baring in mind, I prefer my code be as extremely simple and speedy as possible within the limitations, of course:

JavaScript with HTML5 Canvas

window.onload = function () {      var canvas = document.getElementById("canvas");      var ctx = canvas.getContext("2d");      var FrameSize = 120; //120 pixels     var FrameNumber = 0; //obvious     var img = new Image();     img.src = 'sprite_ani.png';     var last = 0; // no idea         function Render() {        ctx.clearRect(0,0 ,640,480);       now = performance.now();       delta = now - last; // last is 0, how does this work?       last = now; // last is now, why?        if(delta > 20 //what does this value represent) {          FrameNumber += FrameNumber + 1;          delta = 20;       }                 if(FrameNumber>=4){               FrameNumber = 0;       }          ctx.drawImage(img,FrameSize*FrameNumber,0,120,120,0,0,120,120);          window.requestAnimationFrame(Render);     }     window.requestAnimationFrame(Render);    }     

As you can see, it’s extremely simple yet, I’m still struggling to not only understand it but extremely simply implement it, I’m not a fan of over-complicated coding hence why I ditched c++ ages ago.

Could someone in extremely simple english guide me through time-based sprite animation in the context of JavaScript preferably, Id also really appreciate various time-based sprite animation methods being explained too in extremely simple terms but not holding out, I thank you for reading this far.

How can I play an animation as long as the player is on the pressure pad?

I’m making a 2D platformer with Unity. Recently, I implemented a pressure pad system. Basically, when the player triggers the pad, a door near there should be opened. The system works properly but the only problem is when the player stays on the pad, the OpenWhenOn animation (an idle animation for when the door is open) is not playing. I want to somehow make this keep playing as long as the player is on the pad and if it exits the trigger, the DoorClosing animation should be played. I thing there is a problem with the Animator Controller and the transitions. Thanks in advance.

enter image description here This is my Animator Controller. HasExitTime is disabled for all the transitions. The condition for the transition between DoorOpening and OpenWhenOn is set to true and for the transition between OpenWhenOn and DoorClosing is set to false.