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 ;
}
Please format your code better. 1. Erase your existing code. 2. Copy the code you want to paste from your IDE. 3. Press the button labled '101 010'. 4. Paste your code in and commit.
– iwaldrop