I can't make transition from actual animation to previous one
Evening! I have some trouble at calling transition. I can make the transition from up to down but i cant go from down to up. As you can see in Nest picture i make all transition, but only those who came from up are able to be called. The script I'm using is here :
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class AnimatorController : MonoBehaviour
{
int pagNr = 1;
int BackPag=99;
public Animator anim;
void Start()
{
anim = GetComponent<Animator>();
Debug.Log(BackPag);
Debug.Log(pagNr);
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.RightArrow))
{
pagNr++;
BackPag++;
anim.SetInteger("PAg", pagNr);
Debug.Log(BackPag);
Debug.Log(pagNr);
//anim.SetTrigger("EnterPag1");}
}
if (Input.GetKeyDown(KeyCode.LeftArrow))
{
BackPag--;
pagNr--;
anim.SetInteger("PAg", pagNr);
anim.SetInteger("BackPag", BackPag);
Debug.Log(" ");
Debug.Log(BackPag);
Debug.Log(pagNr);
Debug.Log(" ");
}
}
}
Please try to respond as fast as you can!
Thanks in advance!
NOTE: PAg is trigger for up-down transitions and BackPag is for down-up transition!
P.S. Sorry for my english, I'm not so good at it :)
Serju
Answer by TBruce · May 06, 2016 at 10:05 PM
It should not make a difference but try this (You may want to make a backup of your project first). Delete all your transitions. Than create your transitions like this
EnterHS -> EnterP1
EnterP1 -> EnterHS
EnterP1 -> P2Enter
P2Enter -> EnterP1
P2Enter -> P3Enter
P3Enter -> P2Enter
P3Enter -> P4Enter
P4Enter -> P3Enter
P4Enter -> P5Enter
P5Enter -> P4Enter
P5Enter -> P6Enter
P6Enter -> P5Enter
P6Enter -> P7Enter
P7Enter -> P6Enter
Hi! Thanks @$$anonymous$$avina ! I'm going to use this solution to check it soon. Today is the day when I must to present my project and I made something like a carrousel to jump from the last anim to first. When I'll find some time I'll put it in my code.
Serju
Your answer
Follow this Question
Related Questions
MobController 1 Answer
What is causing animation Position strange position changes 0 Answers
Adding a Highscore to game 1 Answer
Multiple enemies and no animations 0 Answers
Can't jump after adding jump animation 0 Answers