function Update () {
if(Input.GetButton(“Fire1”))
animation.Play(“Shoot”);
}
To make my gun start animation, but i also have the same code but (“w”) and (“walk”) on another script on the same mesh…
If i click them both at the same time both animations stops until i release one of the buttons, is there a way to make one of the animation start when i hold them both… is even better if there is a way to blend or merge them so its the same when i press both keys? the gun doesnt have any bones its just the gun.
What is the easiest way to do this?
ty in advance.
You’re using the legacy animation system. Read the Legacy Animation Scripting page for instructions on Animation Blending. Blending lets you play multiple, simultaneous animations on the same bones. You may also want to read about Animation Layers, for example to make the walk animation play on the whole body but the Shoot animation play only on the arms.
You may find it easier, however, to use the Mecanim animation system instead. It lets you set up blending, layers, and more in a visual editor rather than having to hard-code everything in script.