Quick Read: Two Notes on Setting Up an FPS Perspective in Unity
I recently needed to set up this 3D project to have a First-Person Shooter perspective. Aside from applying a ‘Gun Idle’ animation to the avatar and positioning the Main Camera appropriately (and most likely making it a child object of the Player), there were a couple new things I learnt just from setting this up that I’d like to jot down here 😉
1.Make sure to adjust the ‘Clipping Planes’ variables in the inspector:
Specifically, reducing this ‘Near’ variable will most likely reduce the chance of your avatar’s arms and/or weapon from getting clipped out and stop appearing in the Game view.
2. If your character’s arms and the like still aren’t appearing in the Game view, check to see if the arms of your model have a Skinned Mesh Renderer component. If they do, ensure the ‘Update When Offscreen’ boolean is ticked:
As Unity’s documentation outlines, the engine doesn’t update any skinned Meshes that aren’t visible to any camera by default. This is primarily to save on system resources, so in most cases it’ll be performant to leave this unticked. In this case however, we’re essentially always going to want the player’s arm (and perhaps the entire model) to update so it’ll be best to switch this on.
Appreciate this is quite a quick article, but I just thought I’d note these two down in case you’re having some issues with getting your FPS perspective to render correctly. We’ll focus on getting the player’s arms and the like to move appropriately in some subsequent articles on IK rigging and the like 😉