- Home /
Animations interupting Aim-Script
I could need some help right here. I have finally made both animation and aim script in my fps game to work.....but not both in the same time. my animations interupt the aim script so I cant aim. I have tried using a script that stops the animator but the problem is that the gun stops exactly where the animation told it to go at last and my aim script makes the gun just go an amount higher than its current position and if I change the position of the weapon to default position and disable the animator, the aim script wont change the position anymore. Here the script I used to try stop it:
var Gun : GameObject;
function Start () {
GetComponent("Animator").enabled = true;
}
function Update () {
if(Input.GetButton("Fire2"))
{
GetComponent("Animator").enabled = false;
Gun.transform.localPosition = Vector3(-0.181003, -1.282, -0.163);
}
else
{
GetComponent("Animator").enabled = true;
}
} any suggestions? :)
Your answer
Follow this Question
Related Questions
How would I set up this blend tree for my 2d game 0 Answers
FPS - Attach a gun to hands and move arms when aiming up and down 1 Answer
Have some minor problems. Cant tell if its a script issue or a animator issue. 1 Answer
Issue trying to animate multiple models with same controller and script 0 Answers
FPS Aim Down Sights. Exact Position. 1 Answer