- Home /
Problem of creating smooth animations
Hi everyone,
I am working on a 2D game. Simlply I want a UI panel(including some images and buttons) that move from left to middle of the screen. But in editor it is always come with frame by frame(not smooth enough).
I use the method of
1. Transform.Translate(Time.deltaTime,0,0) in update()
2. Vector3.MoveTowards(Startpos, Endpos, speed) in update()
3. Vector3.Lerp(Startpos,Endpos,betweenpoint) in Coroutine()
4. Custom animation in editor
In addition, I tried to change time.deltaTime to fixed time frames.
But in all cases I saw that animation goes by frames, when I play it in android the performance problem is still exist. How can I create smooth animations?
Thanks.
Answer by Zodiarc · Sep 27, 2018 at 09:02 AM
You can use the built in animation system to make UI animations. See here. The only coding you need then is setting variables in the animator.
Thank you @Zodiarc ,
Actually using UI animation system was my 4th option(4. Custom animation in editor).
But even in this system I see the frames. The animation is not smooth enough (I am comparing it with the games in stores like Candy Crush, in animations I can see very small delays between the frames).
Answer by ArseneySorokin · Sep 27, 2018 at 10:43 AM
Sounds to me like your frame rate is low. Try pressing the "Stats" button in the "Game Window" to see what's your frame rate. If it is below 10 you probably need to make some optimizations to your game.
Answer by oguz1ak · Sep 27, 2018 at 09:13 PM
Thanks @ArseneySorokin
To solve problem I check profiler but it seems there is not framerate problem. Rarely it reduces to 30fps but 99% more than 60fps. I share stats screen, I wonder if something wrong?
One of my friend said that one reason would be version of Unity, I am using 5.6
Do you think the reason would be quality settings or some properties of the engine?
Thanks.