- Home /
Problem with Entry state
I'm following this tutorial: https://www.youtube.com/watch?v=YbwlUvnpulE
The guy in the video doesn't have an entry state and it's impossible to remove the entry state. I've written the following code as per the tutorial to set which state to start:
void Update ()
{
setAnimation (4);
}
void setAnimation(int animationNumber)
{
if (animationNumber == anim.GetInteger("animation") || -animationNumber == anim.GetInteger("animation"))
{
anim.SetInteger ("animation", -animationNumber);
}
else
{
anim.SetInteger ("animation", animationNumber);
}
}
So it should be beginning with the fourth state but instead it begins with the default state I've set the entry state as and there is no way to remove it, so I'm not sure what to do. This is what it looks like in the base layer:
@andsee Please can you help me resolve this problem.
Answer by andsee · Sep 02, 2015 at 04:40 PM
You can ignore the green entry state that was added in a recent version of unity it always points to the orange default state and just helps show where things start. The animation system is not my strong point and I don't have time to watch the full tutorial. But try right clicking on the Player_Run_Right and setting that as the default state as it appears in the tutorial.
After that the thing to check is your transitions and that they are comparing the animation variable correctly.
Sorry forgot to get back to you, I figured out the problem a few days ago. You were right to ignore the entry state. It was a simple problem with the "animation" that I was calling, it had to be a higher case "A" and not "a" because that's how I named it in the Animator. Thanks for your help.
Your answer
Follow this Question
Related Questions
problem when using unity build and setting 1 Answer
Mask Component Missing 0 Answers
IPointerUpHandler.OnPointerUp accidentally triggered 0 Answers
monodevelop is not detecting using startapp; 0 Answers
Fading Objects does not work (Unity 5) 0 Answers