Overview
This prompt aims to guide developers in creating an advanced FPS character controller script for Unity 6. Programmers and game developers will benefit from the detailed instructions and code structure provided.
Prompt Overview
Purpose: This script enables advanced character control in a Unity FPS game.
Audience: It is designed for game developers familiar with Unity and C# programming.
Distinctive Feature: The controller includes features like crouching, sprinting, and realistic jumping mechanics.
Outcome: Users will achieve smooth and responsive player movement in their FPS projects.
Quick Specs
- Media: Text
- Use case: Analysis, Classification & Categorization, Generation
- Techniques: Retrieval-Augmented Generation, Structured Output
- Models: ChatGPT, Claude, Gemini AI
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Create an advanced First-Person Shooter (FPS) character controller script compatible with Unity 6.
The controller should include:
– Smooth and responsive player movement
– Realistic jumping and gravity effects
– Sprinting capability
– Crouching mechanics
– Accurate mouse look with adjustable sensitivity
– Clamping to prevent unnatural rotation
Additionally, implement:
– Collision detection to prevent the player from passing through objects
– Ground checking to enable jumping only when the player is grounded
Ensure the code is:
– Well-organized
– Optimized for performance
– Easy to integrate into a Unity project
Include clear comments throughout the code to explain functionality and usage.
# Steps
1. Set up player movement using either Rigidbody or CharacterController.
2. Implement walking, sprinting, and crouching states with appropriate speed adjustments.
3. Add jumping mechanics with proper ground detection using raycasts or collision flags.
4. Apply realistic gravity and falling behavior.
5. Create mouse look functionality with configurable sensitivity and rotation clamping on the vertical axis.
6. Include collision handling to prevent passing through objects.
7. Ensure the script is modular and clean, with comments explaining key sections.
# Output Format
Provide the complete C# script code suitable for Unity 6, properly formatted and including comments.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Open your preferred code editor for Unity.
- Paste the prompt into the editor.
- Follow the outlined steps to create the FPS controller.
- Ensure to test the script in Unity 6.
- Review and optimize the code as needed.
Tips for Best Results
- Player Movement: Use Rigidbody or CharacterController for smooth and responsive movement.
- Jumping Mechanics: Implement ground checking with raycasts to allow jumping only when grounded.
- Mouse Look: Create adjustable mouse look functionality with clamping to prevent unnatural rotation.
- Collision Detection: Ensure robust collision handling to prevent the player from passing through objects.
FAQ
- What is the purpose of a character controller in FPS games?
A character controller manages player movement, jumping, and interactions within the game environment. - How does sprinting affect player movement speed?
Sprinting increases the player's movement speed, allowing for faster navigation during gameplay. - What is ground checking in a character controller?
Ground checking ensures the player can only jump when they are in contact with the ground. - Why is mouse look sensitivity adjustable?
Adjustable sensitivity allows players to customize their aiming speed for better control and comfort.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


