{"id":"cozywitchcraft/anti-wallhop","name":"anti-wallhop","scope":"cozywitchcraft","platform":"roblox","description":"Patches wallhopping from the humanoid controller","version":"0.1.3","latest":"0.1.3","versions":["0.1.0","0.1.1","0.1.2","0.1.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"54e083afc2e659dff1d610a9d391da026f7bafda2a91525ea75bfb34bd8666de","likes":0,"downloads":0,"install":"forest install cozywitchcraft/anti-wallhop","url":"https://forest.dev/p/roblox/cozywitchcraft/anti-wallhop","files":"https://api.forest.dev/ai/package/roblox/cozywitchcraft/anti-wallhop/files","readme":"# anti-wallhop\r\n\r\nPatches [wallhopping](https://devforum.roblox.com/t/flicking-camera-allows-climbing-wall-intersections/298135) from the humanoid controller\r\n\r\n![Character wallhopping with the anti-wallhop turned off vs. on](assets/RobloxPlayerBeta_cKoAtUvkUp.gif)\r\n![Side view of a character wallhopping between two walls with the anti-wallhop turned off vs. on](assets/RobloxPlayerBeta_MpmGKuwfBv.gif)\r\n\r\nWallhopping occurs because the humanoid state machine runs before the physics simulation every frame. When the player has instant control of the character's rotation (e.g. in first person or mouse lock), its root part can clip into the level geometry. This allows the humanoid to detect floors *inside walls* before the simulation can force the root part out.\r\n\r\nThis module works by replacing the built-in landing transition with a custom one running post-simulation, patching wallhopping with minimal effect on the humanoid's physics.\r\n\r\nFor reference, this change affects the humanoid so little that trussflicking, which is almost functionally identical to wallhopping, is preserved.\r\n\r\n![Character successfully trussflicking with the anti-wallhop turned on](assets/RobloxPlayerBeta_HLxxviqXdZ.gif)\r\n\r\nFor those worried about an in-engine wallhop patch in the future, this module can also serve as a wallhop reimplementation by moving the landing floor detection from post-simulation to pre-animation. I haven't implemented this option for practicality's sake.\r\n\r\nI'll write an article further detailing how and why this was made and link it here when finished.\r\n\r\nYou can test the latest version of the anti-wallhop [here](https://www.roblox.com/games/17884774403/Anti-Wallhop-Testing). The source code for the testing place can also be found at [cozywitchcraft/anti-wallhop-testing](https://github.com/cozywitchcraft/anti-wallhop-testing).\r\n\r\n## Features\r\n\r\n* Emulates humanoid floor detection\r\n* Patches wallhopping\r\n* Visualizes floor detection raycasts\r\n* Supports R6 and R15 rigs\r\n\r\n## Usage\r\n\r\nIn a LocalScript in StarterCharacterScripts:\r\n\r\n```luau\r\n-- StarterCharacterScripts/AntiWallhopLoader\r\nlocal AntiWallhop = require(path.to.AntiWallhop)\r\n\r\nlocal antiWallhop = AntiWallhop.new(script.Parent)\r\nantiWallhop:enable()\r\n```\r\n\r\nOr for those concerned about memory management, try the following in a LocalScript in StarterPlayerScripts:\r\n\r\n```luau\r\n-- StarterPlayerScripts/AntiWallhopLoader\r\nlocal Players = game:GetService(\"Players\")\r\n\r\nlocal AntiWallhop = require(path.to.AntiWallhop)\r\n\r\nlocal localPlayer = Players.LocalPlayer\r\n\r\nlocal antiWallhop\r\n\r\nlocal function onCharacterAdded(character: Model)\r\n\tantiWallhop = AntiWallhop.new(character)\r\n\tantiWallhop:enable()\r\nend\r\n\r\nlocalPlayer.CharacterAdded:Connect(onCharacterAdded)\r\n\r\nlocalPlayer.CharacterRemoving:Connect(function()\r\n\tif antiWallhop then\r\n\t\tantiWallhop = antiWallhop:destroy()\r\n\tend\r\nend)\r\n\r\nif localPlayer.Character then\r\n\tonCharacterAdded(localPlayer.Character)\r\nend\r\n```\r\n\r\n## Installation\r\n\r\n### Using [Wally](https://github.com/UpliftGames/wally)\r\n\r\nAdd `cozywitchcraft/anti-wallhop` to `wally.toml` as a dependency.\r\n\r\n```toml\r\nAntiWallhop = \"cozywitchcraft/anti-wallhop@0.1.3\"\r\n```\r\n\r\n### From the Creator Marketplace\r\n\r\nAlternatively, you can get the model [here](https://create.roblox.com/store/asset/18196739150/).\r\n\r\n### From GitHub\r\n\r\n* [Releases](https://github.com/cozywitchcraft/anti-wallhop/releases)\r\n* [Source](https://raw.githubusercontent.com/cozywitchcraft/anti-wallhop/main/lib/init.luau)\r\n\r\n## API\r\n\r\n### Functions\r\n\r\n#### new\r\n\r\n`AntiWallhop.new(character: Model) -> AntiWallhop`\r\n\r\nInitializes the anti-wallhop as disabled.\r\n\r\n#### enable\r\n\r\n`AntiWallhop:enable() -> ()`\r\n\r\nEnables the anti-wallhop.\r\n\r\n#### disable\r\n\r\n`AntiWallhop:disable() -> ()`\r\n\r\nDisables the anti-wallhop.\r\n\r\n#### enableDebug\r\n\r\n`AntiWallhop:enableDebug() -> ()`\r\n\r\nEnables debug visuals. Each raycast is visualized with a line colored red or green depending on the result.\r\n\r\n![Transparent character jumping with debug visuals enabled](assets/RobloxPlayerBeta_6ncHDsmHU7.gif)\r\n\r\n#### disableDebug\r\n\r\n`AntiWallhop:disableDebug() -> ()`\r\n\r\nDisables debug visuals and cleans up debug instances.\r\n\r\n#### destroy\r\n\r\n`AntiWallhop:destroy() -> ()`\r\n\r\nCleans up connections and debug instances because [character destruction must be handled by the end user](https://devforum.roblox.com/t/new-player-and-character-destroy-behavior/2711317/79).\r\n\r\n## License\r\n[MIT](LICENSE)\r\n","readmeTruncated":false}