I have looked in many places and have yet to find my solution. It seems as if every time I try to make progress it causes other problems. Its probably around Day 5 of trying to find a solution. My main problem is my page flip animation, I just figured out how to stop it from playing twice, I also got it to be able to be controlled by 1 animation using the “Speed” feature. Now whenever I play the animation backwards or forward it plays the opposite way and then reverses after a certain time. I don’t understand why this is happening.
Thanks in advance!
My script:
public Animator Book_Animator;
private bool db = false;
public PlayerScript playerScript;
public bool Open = false;
private float Horizontal_Input;
void Update()
{
if (Open == true)
{
Horizontal_Input = Input.GetAxis("Horizontal");
} else
{
Horizontal_Input = 0;
}
if (Input.GetKeyDown("e"))
{
if (db == false)
{
if (Open == true)
{
Book_Animator.SetTrigger("CloseBook");
playerScript.CanWalk = true;
Open = false;
Book_Animator.SetBool("Open", false);
} else
{
Book_Animator.SetTrigger("OpenBook");
playerScript.CanWalk = false;
Open = true;
Book_Animator.SetBool("Open", true);
}
}
}
}
void FixedUpdate()
{
if (Horizontal_Input != 0 && Open == true && db == false)
{
if (Horizontal_Input > 0)
{
Book_Animator.SetBool("Flip", true);
Book_Animator.SetFloat("Direction", 1);
} else if (Horizontal_Input < 0)
{
Book_Animator.SetBool("Flip", true);
Book_Animator.SetFloat("Direction", -1);
}
}
}
public void Anim_Start()
{
db = true;
}
public void Anim_End()
{
db = false;
Book_Animator.SetBool("Flip", false);
}