help a beginner of a fps …
why only 1 animation works =?
function Start()
{
// First set both animations layer value to something different to each other. This allows you to play them both at the same time.
animation["aim"].layer = 1;
animation["dodge"].layer = 2;
// Second set both their speed to 0.
animation["aim"].speed = 0;
animation["dodge"].speed = 0;
// Thirdly play both the animations
animation.Play("aim");
animation.Play("dodge");
}
// Use the mouse input to set the normalized time of the animations to what you want. Something like this.
var maxMouse : float = 366;
function Update()
{
var newTimeAim : float = Mathf.Min(maxMouse, Mathf.Max(0, Input.mousePosition.y)) / maxMouse;
var newTimDodge : float = Mathf.Min(maxMouse, Mathf.Max(0, Input.mousePosition.x)) / maxMouse;
animation["aim"].normalizedTime = newTimeAim ;
animation["dodge"].normalizedTime = newTimDodge ;
}