- Home /
What's the best way of setting up a FPS character?
I have been working on a Voxel style FPS Shooter and when I tried optimizing movement I came across a few problems. Currently I have a parent GameObject which has a Rigidbody attached to it and the control script, which checks inputs and also handles camera movement. The GameObject also has a child for each body part (head, leg, torso etc.) which each have a box collider. The parent object has an animator on it which animates the leg and arm transform to simulate movement. The problem with this setup is that my character doesn't stay the same height because his legs are moving. Also trying to move towards a wall midair will lead to the character slowly sliding down the wall.
I've considered putting a bounding box collider on the parent and changing its layer, so I can still get accurate body part detection when shooting. This doesn't work properly though. My question is if there are any better ways to solve this problem. Thank you guys :)
Answer by ElysiumGames · Nov 26, 2017 at 05:07 PM
I'm pretty new, so take these recommendations with a pinch of salt.
For the camera moving up and down, try locking the (Y?) axis of it.
For the character sliding down the wall, try attaching a physics material to the wall with Friction set to 0.
Hope this helps, but it's purely speculation.
Unfortunately I've already tried applying physics materials with zero friction. The problem is that the feet and arms are animated colliders which cause them to get stuck and I can't find a way to eli$$anonymous$$ate that problem.
Simple solution would be removing the colliders, but if you've got to this point with them I assume you require them somehow for your game.
Your answer
![](https://koobas.hobune.stream/wayback/20220612143355im_/https://answers.unity.com/themes/thub/images/avi.jpg)