- Home /
FPS gun movement
How do i make my gun sway like in call of duty 4?
Answer by FutchProductionsSyndicate · Jun 12, 2011 at 04:36 AM
Use an animation.
Or use gradual motion using the MAthf.lerp function to make it slowly sway from side to side.
But an animation is MUCH easier.
@FutchProductionsSyndicate Thanks man i will try that it makes sense now.
@FutchProductionsSyndicate one more question how do i play the animation while i look to the sides on the mouse?
@$$anonymous$$eith18127389 Sorry, i'm not quite sure how to do that. what you could do is a combination of animations and a Lerp.... Have it loop an idle animation of the gun bobbing and swaying, and when you look to the sides, use the $$anonymous$$athf.lerp function to gradually move the gun and rotate it slightly.
I'm not completely sure how that would work with the animation, but I think it should work fine.
Answer by Yanger_xy · Jun 12, 2011 at 04:37 AM
"duty 4 " I haven't played it yet.Can you describe your question in another way?
NOTE TO MYSELF: I should use a comment next time. Not a answer! -- OrangeLightning :)
Please do things like this as a comment, and he means in the game, "Call of Duty 4" how the gun sways side to side and bobs up and down to make it look like you are walking.
Answer by Kieran Chandler · Oct 15, 2011 at 04:14 PM
make it rotate the same way you make the camera rotate. it is simple. one problem you may find is that it begins to move off of the screen. this is simple to fix just use the Mathf.Clamp() function that is how i did it
Your answer