How to create one moving animation for different positions?

Started by
5 comments, last by Alexander Nazarov 4 years, 10 months ago

Hello. I'm creating a Match3 game in Unity and I have some question about it. When player deletes some tiles from the board they should fly into a bascket. Can I create ONE animation clip such that initial value of animation (tile position) will vary but the destination value (bascket position) will stay the same.

 

This is screenshot of the similar game

 

maxresdefault.jpg

Advertisement

You could interpolate the position from the tile position to the basket position.  That's the only method I can think of.

I am an indie game developer who enjoys pixel art games.

15 hours ago, Pepsidog said:

You could interpolate the position from the tile position to the basket position.  That's the only method I can think of.

Yep, but I want to make some antisipating and easing animation, which I can achieve only with creating an animation clip.

Is this a wrong and bad way if I create an individual animation for every tile(about 100 ones)?

If it will not be realy some artistic organic motion you can quite trivialy achieve very impressive procedural animation, by interpolating the interpolator, take a look at this:

http://codetuto.com/2017/02/7-lerping-tricks-need-know-game-developer/

I would appoint especialy the smoothing where w is interpolator, you can have amazing start/stop motions as well.

  1. w = w * w
  2. w = 3 * (w * w) - 2 * (w * w * w)
14 hours ago, Alexander Nazarov said:

Yep, but I want to make some antisipating and easing animation, which I can achieve only with creating an animation clip.

This may be repeating what JohnnyCode said (not sure), but it's certainly not true that this can only be accomplished using animation clips (not generally speaking at least). Ultimately, the transform positions are under your control, which means you can do whatever you want with them. Also, consider that the built-in animation system likely manipulates transforms as well, so in principle at least you can do yourself whatever the animation system is doing, with whatever custom adjustments you need.

In this particular case, it seems what you need is something like an interpolation from one position to another, using an appropriate mapping ('tweening') function to deliver the desired effect. For example, it may be an 'ease-in, ease-out' mapping function that you're looking for. (I didn't follow JohnnyCode's link, but perhaps this topic is covered therein.)

14 hours ago, JohnnyCode said:

If it will not be realy some artistic organic motion you can quite trivialy achieve very impressive procedural animation, by interpolating the interpolator, take a look at this:

http://codetuto.com/2017/02/7-lerping-tricks-need-know-game-developer/

I would appoint especialy the smoothing where w is interpolator, you can have amazing start/stop motions as well.

  1. w = w * w
  2. w = 3 * (w * w) - 2 * (w * w * w)

Thanks for you response. I've already created some cool animation using cubic Bezier curves.

This topic is closed to new replies.

Advertisement