- Home /
Better way to make a Weapon Bob animation when walk
Hi, what could be the best way to make a weapon bob animation when the player its walking or running on a FPS?
Using a predefined animation for each case, and then play the animation when the player its walking or running with a script...
or
make the weapon bob animation using only script (i dont know how to do it yet, perhaps its easy to manage the animation transitions this way?).
Thanks for any advice on how to do it the better way...
Why don`t you try to search for it? Enter "bob" in search box and see what happens.
Thanks, i already do that, the meaning of this post its to know what think a more experienced user about this specific matter...(i edit the title to fix this).
Answer by Kacer · Nov 24, 2011 at 11:08 AM
The easiest way, for me at least, would be to animate it, scripting your way out of something like this would require that you had some bones to which you could add some rotation scripts, to simulate movement, getting that stuff right wouldnt be an easy task.
On the other hand, if you use an animation you'd have full control over the character and the weapon bob animation, and it would be way easier to make adjustments.
Thank you $$anonymous$$acer, using animations would be the easiest way for me too, if anybody knows what could be the better way to handle transitions from one animation to another and the fire animation while you are still walking, please make a comment about it...Thanks again!
Answer by noswadecyrb · Nov 24, 2011 at 09:34 PM
the easiest way to make the weapon bob using script would be to change the y position over time using a sine or cosine function with the Mathf.sin() of Mathf.cos(). If you don't understand what that means it would be easiest for you do pre written animation
Your answer
![](https://koobas.hobune.stream/wayback/20220613052714im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
unlocking weapon (fps) 1 Answer
Weapon placement and animation 0 Answers
FPS Camera+weapon setup? 0 Answers