Advanced Wall Climb and Wall Slide for Roblox
Generate a responsive vertical movement system for Roblox that lets players slide when they touch walls in the air and climb valid surfaces while meeting input, stamina, and direction requirements. The result is designed for obby, parkour, combat, adventure, and advanced movement experiences.
The prompt requires a prior analysis of the context in your Explorer, including names of RemoteEvents, animations, attributes, settings, and the existing hierarchy. This way, the returned code is adapted to your project instead of relying on generic names or nonexistent objects.
In addition to the commented Luau implementation, the model must deliver installation, configuration, and testing instructions in Roblox Studio. The system prioritizes robust raycasts, connection cleanup, respawn compatibility, and security best practices for any client-server communication related to stamina, progression, or movement validation.
Act as a senior Roblox developer, specialized in Luau, movement systems, raycasting, Humanoid, and secure client-server architecture. Develop an advanced Wall Slide and Wall Climb system adapted to the context of my game, which I will provide below before the code is generated. Before coding, read and fully consider the context I will paste. It may include exact object names in the Explorer, folder structure, existing RemoteEvents/RemoteFunctions, ModuleScripts, stamina system, Character attributes, animation IDs, key mapping, gameplay rules, and existing movement versions. Do not invent objects, remotes, modules, or paths that do not exist in the context. If an indispensable piece of information is missing, ask at most 5 objective questions before generating the code. If the information is not indispensable, assume a reasonable configuration, state the assumption, and centralize all configurable constants at the start of the script. MY GAME CONTEXT (I will fill in): - Relevant Explorer hierarchy: - Type and name of existing scripts/remotes: - Available RemoteEvents/RemoteFunctions and their contracts: - Existing stamina system, attributes, and values: - Available Animation IDs or objects: - Desired keys for climbing/sliding: - Special rules, forbidden surfaces, and exceptions: - Other information: The main result must be ONE complete Luau LocalScript, ready to paste into StarterPlayer > StarterCharacterScripts. Clearly explain that it must be installed in this location so it is recreated on every respawn. Use only current Roblox APIs and valid Luau. Do not use deprecated syntax, arbitrary waits, infinite loops without control, or external dependencies. If the context determines that the architecture requires an additional server ModuleScript or Script, deliver them only as clearly separated complementary components, but keep the main LocalScript functional and explain the exact location of each file. Implement the following behaviors: 1. Wall Slide: when the character is in the air, near a valid vertical wall, and falling, reduce the vertical descent speed to a configurable limit. The system must stop immediately when touching the ground, losing the wall, dying, sitting, swimming, entering an incompatible state, or not meeting the defined conditions. 2. Wall Climb: while the character is detecting a valid wall and the player holds the configured key, allow controlled upward vertical movement. Include maximum speed, maximum duration or optional stamina consumption, and block climbing if there is not enough resource. 3. Robust detection: use Workspace:Raycast with RaycastParams configured to ignore the Character itself and apply, when informed in the context, filters by CollisionGroup, CollectionService tags, attributes, or part names. Validate that the surface is mostly vertical using the normal returned by the raycast, preventing climbing on floors, ceilings, and slopes outside the configured limit. 4. State and transitions: explicitly manage states such as Idle, WallSliding, WallClimbing, and Cooldown. Avoid overlap with jumping, normal falling, swimming, ragdoll, tools, or other states indicated in the context. Perform safe cleanup of RBXScriptConnections, animations, forces, and references when the Character is removed or the Humanoid dies. 5. Stable physical movement: prefer modern and stable mechanisms compatible with Humanoid, avoiding aggressive CFrame changes every frame. If using LinearVelocity, VectorForce, AlignOrientation, or AssemblyLinearVelocity, briefly justify the choice in comments and ensure safe removal/restoration. Preserve normal character behavior outside the wall. 6. Optional feedback: support slide and climb animations, sounds, and particles only if they exist in the context. Do not generate fictitious IDs. If they are absent, leave commented configuration fields for the user to fill in. 7. Quality: use RunService appropriately, dt when needed, clear names, Luau typing where it adds value, helpful comments in Portuguese, and a centralized CONFIG section with all adjustable variables: raycast distance, slide speed, climb speed, cooldown, stamina, and maximum wall angle. MANDATORY SECURITY: wall slide and visual feedback may be local, but the client must never be the authority for damage, coins, inventory, persistent stamina, checkpoints, rewards, or teleportation. If my context includes RemoteEvent/RemoteFunction for stamina, progression, or mobility validation, integrate it with an explicit contract and treat every server response as authoritative. Any input sent by the client must be minimal, and the complementary server script, if needed, must validate player, Character, Humanoid, state, distance, wall, rate limit, and numeric values before accepting any action. Never trust client data to grant permanent advantages. Required response format: first, provide a short list of assumptions and the installation tree in the Explorer. Then, provide the complete code inside a single markdown block with the ```lua language tag. Do not omit sections using phrases like “rest of the code”, “add your logic”, or pseudocode. After the code, explain how to configure the fields in the CONFIG section and provide a practical testing walkthrough in Roblox Studio for respawn, valid wall, slanted wall, floor/ceiling, depleted stamina, cooldown, death, multiplayer with Start Server, and possible conflicts with existing movement scripts.