- Home /
[Closed] How could I create a first-person controller from scratch?
I usually use the built-in FPS Controller from Unity, but I'd like to learn how to make one from scratch. Of course, I want it to be very simple. What are the steps to creating this? Can I do it in a single script attached to a camera? Any help is useful. Thank you!
Alucardj! Thank you so much. I've started watching the tutorials, and they're extremely specific to what I need.
Answer by GrnDyRx · Mar 07, 2014 at 05:00 PM
Look at other ones that have been made. Here is a good one. http://wiki.unity3d.com/index.php/FPSWalkerEnhanced
Answer by robertbu · Mar 07, 2014 at 05:00 PM
I don't know what your feature requirements for a FPS controller are. Unity's FPS input controller that comes standard with Unity is built on top of a Character Controller. To get started building inputs into a CharacterController, see the example scripts in the reference page for CharacterController.Move():
https://docs.unity3d.com/Documentation/ScriptReference/CharacterController.Move.html
You would attach a character controller, then this simple script. It handles left/right/forward/back movement and jumping.
You could step back an build everything from scratch (no CharacterController). The biggest issue is collisions. You would need to add a lot of raycasting code to detect a collision since CharacterController-like scripts typically don't use Rigidbodies and physics.