Cocos2d How to make/run animation more realistic - animation

Simple Animation - first thought that came up, when 2 objects collided.
For example: Player collides with object Bouncer. What would happen?
Player class start bouncing animation
Bouncer class start self animation to inform user that bouncing started
this is simple animation that looks pretty good but, I have an idea how to add more realism to this and i want to, ask is it really possible to do this?
Let's say same situation player collided with bouncer
Make player invisible
In Bouncer class start animation (animation frames painted with Player and Bouncer motion (e.g preparing for jumping))
in step 2 Players position changed, putting players into position where bouncing animation ended
Make player visible
start Jump
If it is really possible, then i think this will look more realistic. Is there any sample code for this?

Animating anything in Cocos2D can be very time consuming. If you are doing vector/pixel work, you must create a frame for every single change in the animation, which can be very challenging if you don't have much in the way of an artistic background. Might I recommend something like Adobe Flash which will semi-automate the animation process. It has a function to export the animation to frames (individual PNGs), which could be turn into an animation using CCAnimation and some helper classes.

You can create your animation using After Effects, for instance, that generates a set o frames. Then you can use a software like Sprite Helper to embed that animation in cocos2d.
On your project you just have to load it and play it when you need.
http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d

Related

How do you get animations in roblox not to overlap

So I am working on a game at the moment and I made an animation that I would like the player to use while walking, I'm having an issue where when the animation plays my character stops moving it's legs and arms. Here is the code that I am using to run the animation, I did not include any variables in it.
AnimTrack = plr.Character.Humanoid:LoadAnimation(Anim)
AnimTrack:Play()
You can't if both animations use the same body parts (even if they do not move them).
The only way to combine animations is to use animations that don't use the same bodyparts (have those disabled which are used by the other animation).
Ideally create your own animations to avoid any unwanted effects.

Unity3d Updating position with animation simultaneously

I have an animation for humanoid models to simulate climbing. I have been looking for a way to stimulate this animation when the model comes next to the window. I used the triggers to determine where the model is and it worked. However, when I execute the animation, the position of the model is not being updated according to the animation. I am using offmesh links and nav mesh agent and I disable nav mesh agent when the model triggers. How can I use the animation and provide the update simultaneously?
Animation Properties
Thanks in advance.
I don't think the animation should take care of the movement. You should control that somewhere else. You could make the animation climb from y = 0 to 5 but then it won't work if your ladder is at y = 3.
You'd better have a method that is called from the animation using AnimationEvent so that when you trigger the animation, it also triggers a movement of the object upwards/downwards regardless of the current position of the object. It would simply use Translate and disabled input until the animation ends.

Unity 2D Animator, confusion on parameters and transitions for platform 2d character

I am new to designing games and have been having trouble for the past couple of days with the animator. I have downloaded a free asset off the Unity store that included a free sprite character and also its animations for idle, walk, run, and jump. My issue is when I go to use this asset pack in my game, I can not for the life of me figure out how to transition between idle->walk, and any state->jump. I believe it has to do with no parameters being set up, as I want the walk animation to occur when my character is moving. The issue is that it seems to be stuck in idle mode. In the animator the transitions are set up, but I can not figure out how to let the animator know when I am moving, and when I am actually idle. How can I connect my characters movement scripts to be used in conjunction with the animation? Do I need to write a new script, that uses new parameters I make in the animator, or am I completely missing something? Again I am very new at this, so I apologize if this is a dumb question but I cannot figure it out. All the videos I have watched only show how to build the animations and put them into the animator, and nothing about the scripts or parameters in specific. Thank you!
Look at the animation transition requirements, then set the required values. For example:
Animator anim = obj.GetComponent<Animator>();
anim.SetTrigger("running");
or
anim.SetFloat("speed", 2);
or
anim.SetBool("running", true);
One small thing that could be going wrong: If you somehow have a reference to the prefab instead of the instantiated object in your scene, it will not work. And to be sure it's not working, play the game, find the object with the Animator in the Hierarchy, click it, and open the Animator window. You can see which state is active.
If this doesn't help, can you describe the transitions in more detail?

Unity 4.3 Play animation on hit

I'm currently building a 2d platformer and encountered a few problems.
My player has a script so that when the player hits a cube with a rigid body, the cube can be pushed. When the character pushes the object, the regular walking animation is displayed.
I want to play the pushing animation at that moment but cant seem to fix it. I read a lot of topics on the internet about the difference between unity new Animator editor and the older versions.
Is there a simple way to trigger the animation on hit, and how do I have to add it in the Animator? Also with witch states should it be connected?
Found it on google, maybe it will help
http://unity3d.com/learn/tutorials/modules/beginner/2d/2d-overview
He uses a Layer for the animation of the cannon so he animates regardless of the body animation.

animation not playing unity

This appears to be such a common problem, that finding answer to my specific case is near impossible, because of the amount of noise in google or forum searches.
I have imported object to unity from blender. This objects had smaller objects inside it. Those smaller objects have animation on them, which was created in unity. If I open the animation window (Window->Animation) and press play - I can see correct movement of an object. Animation is set to play automatically in inspector, culling type is always animate. If I play the game however, animation does not play. Why?
add the animation to the main object, then animate the smaller object...
you have to put animation component to main object, then animate the small part...
it is important...
it should work
I Could not find any unity inspector based answer. For now, the best option I have is to create new script, and in update() check if the animation is playing. If not, play it. Very inefficient, so to whoever might stumble upon this post in the future, I suggest you try to add this.animation.play() in setting up part of the script.
I know it's kinda late, but this is for others having this same issue.
Animations in Unity have types (2 of which I know).
Type 1 can be attached to an object using the Animation Component.
Type 2 can only be used in Animators (Mechanim).
Animations imported with FBX files are type 2 (and as far as I know, animation type in FBX files can NOT be changed), so they will usually not work when attached directly to an object with "Animation". They should be used with Animators and Animator Controllers. Just create a New Controller and add the animation. It will become the default animation state and play automatically.
If you want it to loop, click on the FBX asset, and in the Animation tab, choose Loop Time and click Apply.

Resources