Understanding the difference between the two systems, and which might be the right one for you.
using UnityEngine;
using AnythingWorld.Animation;
public class ExampleClass : MonoBehaviour
{
public float speed = 0.0167f;
private float velocity;
private GameObject createdGameObject;
private RunWalkIdleController controller;
public void Start()
{
createdGameObject = AnythingMaker.Make("Cat", RequestParameter.UseLegacyAnimatorInEditor(true));
}
public void Update()
{
if (Input.GetKeyDown(KeyCode.W)) velocity += speed;
if (Input.GetKeyDown(KeyCode.S)) velocity -= speed;
velocity = Mathf.Clamp(velocity, 0, speed * 2);
if (controller == null)
{
controller = createdGameObject.GetComponentInChildren<RunWalkIdleController>();
}
else
{
controller.walkThreshold = 0;
controller.runThreshold = speed;
createdGameObject.transform.Translate(0, 0, velocity);
controller.BlendAnimationOnSpeed(velocity);
}
}
}