How to make a sphere animate and move from one platform tile to another ?
I'm going to make a game project for the highschool, I'm at the first years to my cursus and i can't find documentation about what I'm doing.
let me introduce what kind of game I make: I make a 2D platform game and it look like this :I'm looking for to animate my "player" (that's the sphere) when it move from a platform to an other platform. I use "Animation" component to animate the player but the animation are played in absolute position not a relative position.
But when I push on the UpArrow, the animation comeback to the original point. How Can I make a sphere animate and move this sphere from platform to platform ?
Answer by Manuel_Jerome · Feb 18 at 05:01 AM
Try using transform.position += transform.forward speed Time.deltaTime; Speed should be a float set to an arbitrary value, say...2f.
Answer by RaionHoshi · Feb 18 at 09:27 AM
I use transform.translate( (float) x, (float) y, (float) z); that's more presise but I can't animate it.. it's working when I pay but that isn't smooth like transition you know... :P
I had try to use Animation component and to put "My_Transition.Play("Name_Of_Scene");" just after the instruction above.
I made this :
if (My_IsPlaying_forward == true)
{
My_Animation.Play("Players");
transform.Translate((float)1.25, 0, 0);
My_IsPlaying_forward = false;
}
but the animation comeback to the """"Spawn point""""
i'm a novice in unity and i'm on my first years on programmation school. I need to learn tu use Untiy by myself and it's not eazy for me ..
Your answer
![](https://koobas.hobune.stream/wayback/20220613053135im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
I can't move my bones 0 Answers
Animation flipped in wrong direction? 1 Answer
Need Help With Having Enemy Arms Pointed at Player 1 Answer
2D Sprite Animation on a 3D game 0 Answers
Mixamo x Unity - Z axis animation 0 Answers