{"id":"coffilhg/firstpersonview","name":"firstpersonview","scope":"coffilhg","platform":"roblox","description":"Primitive Generic Viewmodel of the characters BodyParts; Designed for R6 by default, example for R15 can be found in the GitHub Repository README","version":"1.0.0","latest":"1.0.0","versions":["1.0.0"],"license":"MPL-2.0","licenseRating":"caution","licenseCaveats":["File-level copyleft: if you modify this package's own source files, those modified files must be made available under MPL-2.0. Using it unmodified in a closed-source game is fine."],"licenseVerified":false,"dependencies":{"coffilhg/firstpersondetector":{"version":"^1.0.0","alias":"FirstPersonDetector"},"coffilhg/humanoidcameraoffsetcontroller":{"version":"^1.0.0","alias":"HumanoidCameraOffsetController"}},"integrity":"4c80061148f9ee9d580cb69121962035fb8029dd3779adb65ed58ac4aeba0d78","likes":0,"downloads":0,"install":"forest install coffilhg/firstpersonview","url":"https://forest.dev/p/roblox/coffilhg/firstpersonview","files":"https://api.forest.dev/ai/package/roblox/coffilhg/firstpersonview/files","readme":"# FirstPersonView\r\nPrimitive Generic Viewmodel of the characters BodyParts\r\n\r\nDesigned for R6 by default, example for R15 can be found below\r\n\r\nModuleSettings are chainable\r\n\r\n\r\n\r\n## Available Here!\r\n- **[This repository](src/init.luau) ~ [src/init.luau](src/init.luau)**\r\n- **[Wally](<https://wally.run/package/coffilhg/firstpersonview>)**\r\n\r\n    ```toml\r\n    FirstPersonView = \"coffilhg/firstpersonview@1.0.0\"\r\n    ```\r\n- **Rotriever**\r\n\r\n    ```toml\r\n    FirstPersonView = \"github.com/Coffilhg/Useful-Modules@FirstPersonView/1.0.0\"\r\n    ```\r\n\r\n<!-- **[Creator Store](<https://create.roblox.com/store/category/gameplay?creatorName=coffilhg>)** ~ **[FirstPersonView](<https://create.roblox.com/store/asset/123456789/FirstPersonView>)**-->\r\n\r\n---\r\n\r\n## Usage Example\r\n\r\n```luau\r\n--!strict\r\nlocal Players = game:GetService(`Players`)\r\nlocal RS = game:GetService(`ReplicatedStorage`)\r\n\r\nlocal Packages = RS:WaitForChild(`Packages`)\r\n\r\nlocal FirstPersonDetector = require(Packages.FirstPersonDetector)\r\nFirstPersonDetector:SetFirstPersonEnterMinDistance(0.8) -- more than usually, because the usual setup still has a little of floating with R15 characters\r\n\r\nlocal FirstPersonView = require(Packages.FirstPersonView)\r\nlocal R15BodyPartsWhitelist = {\r\n\t[\"LeftFoot\"] = true,\r\n\t[\"LeftHand\"] = true,\r\n\t[\"LeftLowerArm\"] = true,\r\n\t[\"LeftLowerLeg\"] = true,\r\n\t[\"LeftUpperArm\"] = true,\r\n\t[\"LeftUpperLeg\"] = true,\r\n\t[\"LowerTorso\"] = true,\r\n\t[\"RightFoot\"] = true,\r\n\t[\"RightHand\"] = true,\r\n\t[\"RightLowerArm\"] = true,\r\n\t[\"RightLowerLeg\"] = true,\r\n\t[\"RightUpperArm\"] = true,\r\n\t[\"RightUpperLeg\"] = true\r\n}\r\n\r\nlocal player = Players.LocalPlayer :: Player\r\n\r\nlocal function OnCharAdded(char : Model)\r\n\tlocal hum = char:WaitForChild(`Humanoid`) :: Humanoid\r\n\t\r\n\tif hum.RigType == Enum.HumanoidRigType.R6 then\r\n\t\t-- default R6 config (all body parts except Torso and Head)\r\n\t\tFirstPersonView.ModuleSettings.LTMSettings:SetWhitelistedParts()\r\n\t\treturn\r\n\tend\r\n\t-- otherwise an R15 config\r\n\tFirstPersonView.ModuleSettings.LTMSettings:SetWhitelistedParts(R15BodyPartsWhitelist)\r\nend\r\nOnCharAdded(player.Character or player.CharacterAdded:Wait())\r\nplayer.CharacterAdded:Connect(OnCharAdded)\r\n\r\nprint(\"Local script loaded\")\r\n```\r\n\r\n---\r\n\r\n## To-Do\r\n\r\n- [ ] Expand the README\r\n\r\n---\r\n\r\n## Dependencies\r\n\r\n- [FirstPersonDetector](<https://github.com/Coffilhg/Useful-Modules/tree/FirstPersonDetector>)\r\n- [HumanoidCameraOffsetController](<https://github.com/Coffilhg/Useful-Modules/tree/HumanoidCameraOffsetController>)\r\n\r\n---\r\n\r\n## License & Attribution\r\n\r\nThis module is licensed under the **Mozilla Public License 2.0 (MPL-2.0)**.\r\n\r\n#### What this means for Roblox Developers:\r\n* **Use & Modify:** You can freely use this module in any public, private, or commercial Roblox game.\r\n* **File-Level Copyleft:** If you modify the source code of this module itself, you must make your modified version of the module publicly available under the MPL 2.0.\r\n* **No Viral Code Leakage:** Including this module in your game does **not** force you to open-source your other game scripts, UI layouts, or proprietary codebase. \r\n\r\nSee the full terms in the [LICENSE](LICENSE) file.\r\n\r\nAttribution to all dependencies is included in [Notice](NOTICE)\r\n\r\nCopyright © 2026 @Coffilhg (Roblox UserId 517222346)","readmeTruncated":false}