How do i code for a animation in unity for clones of the SAME object?
I am trying to code a animation for my gun in my FPS multiplayer game. I have made the animation in blender and the model, did the logic in unity and it works fine, with one problem. when I connect another player, shooting with either player triggers the animation for both creating a weird effect. I cannot find the issue in my code so hopefully someone can point me in the right direction. the code:
using UnityEngine; using System.Collections;
public class GunAnimation : MonoBehaviour {
private Animator anim;
void Start () {
anim = GetComponent<Animator>();
}
void Update () {
if (Input.GetButtonDown ("Fire1"))
{
anim.SetBool ("shoot", true);
} else
{
anim.SetBool("shoot", false);
}
}
}
Comment
Your answer
Follow this Question
Related Questions
MobController 1 Answer
Why wont my animation work? 0 Answers
My movement gets blocked, when I activate the animator 1 Answer