- Home /
This post has been wikified, any user with enough reputation can edit it.
Mecanim problem with setting speed
Hi I've had this problem for a while now and I still cant get it right, I hope someone can help. Is it possible to have my controller script on obj1 and my animation controller script on obj2?
And if so, how can the animation speed be controlled by obj1's movements?
Heres obj1 movement script
public float speed = 210;
public Vector3 tilt = Vector3.zero;
void Start ()
{
}
void FixedUpdate ()
{
tilt.x = -Input.acceleration.y + Input.GetAxis ("Horizontal");
tilt.z = Input.acceleration.x + Input.GetAxis ("Vertical");
rigidbody.AddForce(tilt * speed * Time.deltaTime);
}
I dont know how to set a variable to equal the speed of the movement on this script, so I can feed that into anim.SetFloat() on obj2. Please help!
Comment
Your answer
Follow this Question
Related Questions
Problem adding individual clip speed 2 Answers
mecanim animation runs at random speed on iOS 0 Answers
Mecanim - changing animation clip speed, through script? 4 Answers
Automatically adjusting the speed of a walking animation to avoid foot-sliding? 1 Answer
Are mecanim blend trees linear? 2 Answers