CylindricalCast is the only Open-Source solution to cylindrical casting tasks on Roblox. The API makes use of the updated Roblox Raycast engine, It has a simple and easily readable API for casting cylinders!
Installation
Manual Installation
You can either take the toolbox Asset or download the latest Release and insert it into studio.
Rojo
You can use git submodules to clone this repo into your project:
$ git submodule add https://github.com/IdleBrickRBLX/CylindricalCast packages/CylindricalCast
Once inserted, Sync Roblox Studio and Rojo using the Rojo studio Plugin
Usage
local RunService = game:GetService("RunService")
local CylindricalCast = require(CylindricalCast_PATH_HERE)
local Cylinder = CylindricalCast.new({
Quality = 30, -- The higher the quality the more precision you have. Recommended 15, 50
Size = Vector3.new(1, 2, 2), -- (Thicknes, RadiusY, RadiusZ)
Ignore = {},
ThicknessQuality = 2 -- Quality on the X axis. Recommended 2, 3
})
RunService.RenderStepped:Connect(function()
local yourCFrame = CFrame.new(0,5,0)
Cylinder.Size = Vector3.new(1, 3, 3)
Cylinder.RaycastParams.FilterDescendantsInstances = {}
local Cast = Cylinder:Solve(yourCFrame)
if Cast then
print(Cast.Instance)
print(Cast.Position)
end
end)
Documentation
For a full overview of the API please head over to the Docs website