x


How to achieve the sprint effect

I'm currently working on a FPS game. Just want to know is there any way to make the camera shaking to imitate sprint effect?

Thanks for any help

more ▼

asked May 10 '12 at 11:06 AM

071813g gravatar image

071813g
26 4 8 10

Yes, there is a way. Next question?

May 10 '12 at 12:04 PM syclamoth

I've tried methods like animating the camera or adding command like "cam.transform.localPosition = Random.insideUnitSphere " in script. But none of them achieve the result.

I want the camera to shake without affecting the player's movement .So what exactly do I need to add in scripting?

For instance like this?

if(Input.GetKey(KeyCode.LeftShift)) //move the camera angles

May 11 '12 at 04:50 AM 071813g

You should look around on this forum because I think I have seen answers to this many times. I give a hint search bar, run, crouch.

May 11 '12 at 07:33 AM fafase

I found them! I guess I didn't type the right key word for searching. Sorry for this.

Yes, there is script called Headbobber, this is exactly what I'm looking for.

May 11 '12 at 08:31 AM 071813g

put a link to the answer for other people that want to do this

May 11 '12 at 08:37 AM qwertyqaz
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You could simply animate the camera (either directly in Unity or in any modeling application, via an object that you parent the camera to) to get the sprint movement and then blend that animation depending on the velocity of the player. Not sure if it works with the ootb FPS controller, though. You might have to write your own (if you haven't already).

more ▼

answered May 11 '12 at 06:07 PM

Piflik gravatar image

Piflik
5.4k 15 26 44

I will try it someday, thanks for your response

May 12 '12 at 04:04 PM 071813g
(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:

x2987

asked: May 10 '12 at 11:06 AM

Seen: 409 times

Last Updated: May 12 '12 at 04:04 PM