"Animation Clip with relative movement"

"Animation Clip with relative movement"
0.0 0


At the moment, the workflow to create an animation clip for a sprite, you have to

Create > Animation Clip to create the animation clip object.
Add an “Animation Component” to add an animation component to a Node.
Drag the Animation Clip to the “DefaultClip” or “Clips” list on the node.
Use the Timeline Editor to actually alter the clip and add easing curves to the sprites movement.

However, I have a number of sprites that I want to move the same way - I can attach the animation to them, but they all animate from the recorded starting position of the first sprite.

Also, if I move the first sprite, the Animation Clip reverts the animation to the recorded starting position.

I remember in Cocos2d-x / Cocos Studio that the equivalent “Animation” structure could be played back in a relative way, such that you could even additively combine animation clips - A vertical bounce animation clip played at the same time as a horizontal movement animation clip would result in the node tracing a wave.

I seem to be dumb: How can I get the same facility in Cocos Creator?


You should make your sprites as child of your root node in prefab’s Node Tree. This sprites are able in Timeline Editor.



I know this is an old question, but my current problem is the same. I don’t think the solution of creating the animated sprite in a child solves the problem, unless I understand the solution wrong.

I am making another game, which is action game. I need to make some skill animations that moves the character from one point to another by using character animations. I need it to start the animation from where it is left off. Say skill A has an animation from (0, 0) to (100, 0), and skill B from (0, 0) to (50, 0). In the game, the Player cast skill A and skill B, which means it should animate from (0, 0) to (100, 0), and then (100, 0) to (150, 0), not resetting the animation back to 0 after skill A animation is done.

Is there a way to make the animation to start relatively from where the node is right now?


Nevermind. My end solution is to add the animated character to a node, then make that parent node to “follow” the animated character. “Follow” as in grab the character’s position and use it to move the parent node, then reset the animated sprite position to 0. By that, the parent acts as the anchor of that node’s relative movement.

It comes with tons of problems though (physics, collider, direction, etc.) cause it’s definitely hackish, but it’s the only option I have so far I guess.