Hi!
Is the first time that I’m using Unity, and I’m having some issues. I have a 3D object animated in Cinema 4D that I imported to Unity. I need to play the animation of this object when I click and drag my mouse up, and rewind it when I click and drag the mouse down. What 3# script can I use to do it?
Thank you
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
public Animator anim;
void Update ()
{
if (input.GetKeyDown("Mouse0") && input.GetAxis("MouseY") > 0)
{
anim. SetTrigger("forwardAnimation");
}
if (input.GetKeyDown("Mouse0") && input.GetAxis("MouseY") < 0)
{
anim. SetTrigger("backwardsAnimation");
}
}
}