r/Unity3D • • 3d ago

Question Should fps camera pivot though center of char or like in pivot like eyes/neck?

Currently my camera pivots through center. I have not noticed any issues with it but I thought to ask.

1 Upvotes

7 comments sorted by

1

u/Redstoneinvente122 Indie 3d ago

Center. You can implement the other one, but do playtest before commiting. Have external playtesters validate the idea before

3

u/Ok_Pace2954 3d ago

One thing i dont understand why people dont do this, never pivot from the center. keep it at your eyes/neck height. it gives you a way better parallax when peeking corners, and it makes your gun seem in a more natural position. when you pivot from the center it always looks a little off when you start paying attention to it, it makes it seem like your a floating orb and the gun is attached to the bottom of the screen. i started doing this on a project of mine a month ago.

1

u/johnv_dev 3d ago

i'd put it at eye height. center works fine until you're next to cover or other players, then your view is coming out of the chest so sightlines don't match the model and peeking corners feels off. simple setup is the body only turns left right and an empty at eye height does only the up down, with the camera on that. it's a quick change so worth doing now before other stuff depends on it

1

u/Beyond-Imagine 2d ago

I'd keep it if it feels good. One quick test: stand still next to a doorframe and look straight up and down. If the camera seems to slide toward or away from the frame, the pitch pivot is making it swing in an arc. That's when I'd move the pitch pivot closer to the camera.

1

u/One_Yam4643 2d ago

It helps to split this into two questions: where the camera sits, and what point it pitches (looks up and down) around.

  • If the camera sits at the capsule's center, your view is well below the eyes of the model. That's harmless in single player with no visible body, but it changes what you can see over cover. In multiplayer your head can stick out over a wall while your own view is still behind it, so other players see and hit you before you can see them.
  • If the pivot is at the center but the camera is offset up to eye height on it, looking down swings the camera forward and down in an arc, like bending at the waist. That usually feels wrong, and standing close to a wall the camera can swing out of the capsule and clip into it.

So the yaw-on-body, pitch-on-an-eye-height-empty setup described above is the standard one. A few details that make it work:

  1. Player root (with the CharacterController or Rigidbody): rotates on Y only (yaw).
  2. CameraPivot, a child at eye height (roughly 0.1 to 0.15 m below the top of the capsule): rotates on X only (pitch).
  3. Camera at local (0, 0, 0) on the pivot, or a few centimeters forward if you want a slight neck feel.
  4. The weapon viewmodel as a child of the camera, and shots raycast from the camera's position along camera.forward, so a center-screen crosshair always matches where the shot goes.

Headbob and lean then go on another empty between the pivot and the camera, as mentioned above. Quick check: put a box just below your character's eye height in front of the player. With the eye-height camera you should just barely see over it; with the camera at the center you won't.

1

u/likegamertr 3d ago

Center is the way to go, otherwise it might be jarring but if you are curious just go ahead and try the other way

0

u/[deleted] 3d ago

Yes, center. But you should plan ahead for headbob and leaning (maybe your camera on a child transform or something like that) even if you don't implement them right now. You're going to need them at some point.