Step Height Controller
Loags
$0.0
(no ratings)
Date |
Price |
---|---|
日期和时间 |
价钱($) |
09/28(2024) |
0.0 |
11/24(2024) |
0.0 |
Jump AssetStore
Step Height Controller allows players to smoothly step over obstacles without Unity’s Character Controller. Easily integrates with custom movement systems for full control over character physics.If you have any questions about the package or its capabilities, please feel free to contact me: https://www.loags.de/contact/The Step Height Controller is a flexible and easy-to-use system for Unity that allows your player to automatically and smoothly step over obstacles, such as stairs or ledges, without the need for manual jumping input.Key Features:Step Detection: Automatically detects steps and obstacles in front of the player.Smooth Motion: Provides a seamless stepping experience with adjustable step height and speed.Customizable: Tweak parameters such as step height, smoothness, and angle thresholds to suit any game environment.Debugging Tools: Includes visual debugging in the Scene view to easily track step detection behavior during development.Modular: Integrates easily with any movement system. The included MovementController demo shows how it can work with basic movement logic, but you can use it with your own custom movement controllers.StepHeightController System - READMEOverviewThe StepHeightController is a component designed to handle a player's ability to step over obstacles of varying heights in a smooth and controlled manner. It detects nearby obstacles and smoothly moves the player over them if the conditions for stepping are met. This system is highly configurable and can be used in combination with your own movement controllers, or the included MovementController demo, to create a seamless player movement experience.Features - Step Detection: Automatically detects nearby steps or obstacles that the player can step over. - Smooth Step Motion: Smoothly lifts the player over obstacles within a configurable range. - Customizable Settings: The maximum step height, step angle threshold, and step smoothness can all be customized via the inspector or programmatically. - Debugging Tools: Includes options to visualize step detection and movement in the Unity scene view. - Collision Handling: Works with Unity's physics system to ensure correct handling of obstacles and collisions.How It WorksThe StepHeightController operates by: 1. Detecting nearby obstacles using overlap spheres and raycasts. 2. Calculating if the player can step up onto the obstacle based on its height, distance, and angle relative to the player's movement direction. 3. Moving the player smoothly over the obstacle if all conditions are met.This process is repeated in real-time as the player moves, ensuring that they can navigate steps or small ledges seamlessly without manual jump input.How to Use1. Adding the StepHeightControllerTo use the StepHeightController in your game: 1. Attach the StepHeightController to your player GameObject: - In the Unity Editor, select your player GameObject. - Click on "Add Component" and search for StepHeightController. - Add the component to the player. 2. Configure the StepHeightController: - Adjust the Step Height, Step Up Smooth Factor, and Step Up Angle Threshold to fit your desired player stepping behavior. - Enable or disable debugging options in the "Debug" section to visualize how steps are detected in the scene view.2. Using with Custom Movement ControllersThe StepHeightController can be used alongside your own custom movement logic.You can integrate it by simply calling CheckForStep() within your movement controller's logic, usually in the update or movement function,whenever your player is grounded and moving. Here's an example:private void DoMovement(){ if (isGrounded && hasMovementInput) { stepHeightController.CheckForStep(); // Integrate the step detection } // Your custom movement logic here}3. Using with the Demo MovementControllerIf you want to quickly test out the stepping feature without implementing your own movement controller, you can use the provided MovementController demo.The MovementController automatically integrates the StepHeightController and provides basic player movement, rotation, and jumping. 1. Attach the MovementController and StepHeightController components to your player GameObject. 2. Configure both controllers as needed (step height, movement speed, etc.).4. DebuggingTo help visualize the step detection process in the editor: - Enable Debug Visualization in the StepHeightController inspector. - Use Debug Logs for detailed information about step detection and movement in the console.Key Configurable SettingsStep Settings - Step Height: Maximum height that the player can step up. (Default: 0.5) - Step Up Smooth Factor: How smoothly the player steps up onto obstacles. Higher values make the movement smoother and slower. (Default: 4.5) - Step Up Angle Threshold: Maximum angle between the player’s movement direction and the step direction. If the angle is too large, the player won’t step up. (Default: 65°)Debug Options - Debug Logs: Enable/disable logging of debug messages. - Debug Warnings: Enable/disable logging of warnings. - Debug Errors: Enable/disable error logs. - Debug Visualization: Visualize the step detection process in the Unity scene view.ExampleHere is an example configuration for the StepHeightController:StepHeightController: Step Height: 0.5 Step Up Smooth Factor: 4.5 Step Up Angle Threshold: 65 Layers To Ignore: Player (Layer) Debug Log: false Debug Visualization: trueThis configuration allows the player to step up to obstacles that are up to 0.5 units high, with a smooth stepping motion.Debug visualizations will be shown in the scene view to help with understanding how the step detection works.Best Practices - Tuning Step Settings: Test different Step Height and Step Up Smooth Factor values to match the style of movement you want. For example, larger characters may need higher step heights, while more agile characters may require quicker step motions. - Avoid Overlapping Movements: Ensure that your custom movement controller doesn’t override or conflict with the StepHeightController's movement when a step is detected. - Grounded Check: Always ensure your player is grounded before calling CheckForStep() to prevent unexpected behavior in mid-air.Limitations - The StepHeightController is designed for small to medium steps (e.g., stairs, ledges). It is not intended for climbing large obstacles or complex parkour-style movement. - The system relies on Unity's physics engine and may need adjustments depending on the player’s collider setup, especially for custom or non-standard character rigs.Conclusion - The StepHeightController provides a robust and flexible way to handle stepping over obstacles in your game. Whether you're using it with the provided demo MovementController or integrating it into your custom system, it can be a powerful tool to create smooth, natural player movement across uneven terrain.Feel free to modify the settings and experiment with the configurations to best suit your game's movement requirements!Key Features:Automatic Step Detection: Detects nearby obstacles and steps the player up onto them without manual jumping.Customizable Step Settings: Includes adjustable step height, smooth factor, and angle thresholds to fit different environments and character types.Smooth Stepping Motion: Provides a smooth, natural transition when stepping over obstacles, avoiding jarring movements.Debugging Tools: Debug logs and visual aids help track step detection and movement in real-time, useful during development.Modular Design: Works independently of Unity’s Character Controller, easily integrates with custom movement systems.Collision Handling: Uses Unity’s physics system to handle step-up collisions and checks, ensuring accurate interaction with the environment.Demo Movement Controller: Includes a basic movement controller to demonstrate step functionality, but can be replaced with your own custom controller.