x


FPS gun movement

How do i make my gun sway like in call of duty 4?

more ▼

asked Jun 12, 2011 at 04:04 AM

Keith18127389 gravatar image

Keith18127389
0 36 23 27

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered Jun 12, 2011 at 04:36 AM

FutchProductionsSyndicate gravatar image

FutchProductionsSyndicate
240 59 44 49

@FutchProductionsSyndicate Thanks man i will try that it makes sense now.

Jun 12, 2011 at 04:53 AM Keith18127389

@FutchProductionsSyndicate one more question how do i play the animation while i look to the sides on the mouse?

Jun 12, 2011 at 04:54 AM Keith18127389

@Keith18127389 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 Mathf.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.

Jun 12, 2011 at 05:50 AM FutchProductionsSyndicate
(comments are locked)
10|3000 characters needed characters left

"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 :)

more ▼

answered Jun 12, 2011 at 04:37 AM

Yanger_xy gravatar image

Yanger_xy
405 66 56 74

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.

Jun 12, 2011 at 04:42 AM FutchProductionsSyndicate
(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Oct 15, 2011 at 04:14 PM

Kieran Chandler gravatar image

Kieran Chandler
25 7 6 10

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1657
x288
x33

asked: Jun 12, 2011 at 04:04 AM

Seen: 2468 times

Last Updated: Oct 15, 2011 at 04:14 PM