Position of player changes when the attack animation starts - unity - animation

So I did an attack animation in the program Aseprite and everything was fine with the animation, but when I put in inside the animator in unity the character changes position.
Here's the images, first one is a gif with the animation running as I want, and then the before and after of the animation in Unity.
I know it's small but I hope you can see

This is because it's setting the center point at the location, and the gif is wider than the standard player image, you will need to offset to compensate.

So I just sliced the sprites again but with the pivot to the left instead of center, and then adjusted the Collider. It seems to work. Not sure if it's the perfect way though.

Related

Flip 2D asymmetric animation in Unity3D

I want to flip my 2D character (asymmetric) from right to left using the animator in Unity3D
I have the sprite sheet with both left and right sprites and I did a controller with the animations facing right, now I need to flip the animations to the other side
Done:
Sprite sheet with both animations left and right
Animation controller with animations facing right
Goal:
Make my character change animations facig right to facing left and viceversa
I'm aware of the code to change the local scale, but I'm not interested in changing scale, I'm looking for a way to flip the animation
Thanks
You can flip the animations changing the x/y scale from positive to negative. Why you are not interest in changing the scale? You can flip the animations with this method.
Sorry for my English and good luck.

Unity2D - Player relative animation positioning

I'm making a 2D platformer and I've come across a really annoying problem where if I move my player character GameObject to another location on the scene, my player becomes stuck and the game spazzes out, jumping from the players original location and the position I moved it to.
My player character is made up of many parts, each a separate GameObject. I know the problem is definitely in my animation, because if I disable the animator component, the problem goes away, just I don't have my animations anymore. I believe the problem may be in the player character's Idle Animation and it's position property. There is no script attached where his starting location is hard coded.
How can I make the child Gameobjects move relative to the parent Player GameObject? I cannot move the player in the scene from its original location without the game glitching up.
Here are some screenshots
[Player and it's parts in Hierarchy]http://i67.tinypic.com/bdlc1j.png
[Idle Animation]http://i64.tinypic.com/2gtp99x.png
[Player's original Location, he works if starting here] http://i66.tinypic.com/261jb6c.png
[Player is Moved, game bugs out] http://i67.tinypic.com/292a2c3.png
Try to disable "Apply Root Motion" flag in the Animator component.
The problem should be related to the fact that the animation changes the position values
My guess is that you have animated the different parts by moving then around in the editor and recording that. This meas that the animation is keeping track of the original position at which you did the animation. Try deleting those parts from the animation.
I couldn't fix the spazzy-jittering problem that occurs when I move the player character to another position on the scene, but I did find a way around it. The problem definitely lied within the Animator component and the gameObject's Rigidbody2d.
Instead of moving the player to another position, I instead made a 'Spawn Point' which the player starts from when first playing the scene, and that was able to be moved freely around. Pretty much:
void start(){
transform.position = spawnPoint.transform.position;
}

Pivot for an animation in Unity3D (4.3)

What I want to do:
When a unit lands after falling I want to give it a slight animation of being "squeezed" to the ground and then going back to normal. (Say a slime blob falls and lands, it would get squeezed a little)
Using Pivot "Top Left" on all my sprites the issue that when I scale the sprite in the animation it doesn't scale to the bottom but to the top. My current temporary workaorund is also translating the sprite downwards to counteract that and make it look slike the sprite is being squeezed to the floor. However, there should be some better solution that works with multiple spritesizes and so on.
One thing would be changing the pivot point for just this animation, or maybe a movement thats percentual since the scaling is too. How would I do these though?

Unity 3D Model Y Translation when Switching animations

I made an animator for my Player Character, I have 2 differents animations.
When I play only one, nothing, it's cool, the character is doing the animation.
OwnAnimator.SetBool("running", true);
But when I have multiple animation (2), in my AnimatorController, the player goes under the floor instantly at the runtime O_O.
Please someone can help me ? :)
What is your second animation? Since animations can affect the transform position it is possible that your animation changes the Y-axis of the transform.

Flash animation help

I am a complete novice when coming to using Flash but I am looking to create an animation similar to the line into text animation at:
http://www.louisebradley.co.uk/fl/
where instead of running from the top of the screen I want the line to effectively stretch across my homepage horizontally.
I have created an animated gif that does the job but it takes a long time to stretch across 974 pixels in width, and if the frames are reduced it takes away any smoothing effect. I did this in photoshop by simply creating 20 or so frames, each increasing the size of the line by 60 pixels until the full page is covered.
Would I be better off creating the effect in Flash? And if so, where on earth do I start!! Would tweening do this, and how I would I implement it?
Thanks in advance for any help!
I am assuming you are talking about the line to the left of the main navigation? If this is the case, this is being done using a mask that is tweened. You can simply draw out the shape you want "wiped" across the screen and than on the layer above it, draw a box over the shape to be animated. Right click the layer the box is on and select "mask". You can now tween the mask to move from right to left over the shape you drew and it will appear to wipe over. Just remember, whatever the mask is currently over, is what will show through from the layer that is masked. Think of the mask as a window. This can be completely done without actionscript and only using the timeline.

Resources