- Home /
How to add some animation?
I need something like in 2048 game, when two tiles gets merged..
Answer by Hachley · May 08, 2014 at 10:28 PM
You could try moving one sprite to anothers location, then disable both sprites and enable the third one.
But that's how it would work, what do you mean if that's not it?
I can only assume you're stuck at animating the tiles but got the merge covered already, you can move objects smoothly over time by multiplying their speed with Time.deltaTime in the Update function
float speed = 5.0f;
Vector3 direction = Vector3.up;
void Update()
{
transform.position += Vector3.up * speed * Time.deltaTime;
}
This makes the object with the script attached move at 5 meters per second. (taken that you didn't adjust Time.timeScale for slow motion effects)
ok, let me explain.. in the original 2048 game when appears a new tile it's kind of jumps up (this tile becomes bigger for a moment)
I'm talking about tile appearing animation and not about moving..