{"id":"alternativelua/enaltcast","name":"enaltcast","scope":"alternativelua","platform":"roblox","description":"A fast and easy to use caster","version":"1.0.0","latest":"1.0.0","versions":["1.0.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"45cc1a6ee3daa67acd65d74eebcf8732604b3de30172047513076f53c9c28ccf","likes":0,"downloads":0,"install":"forest install alternativelua/enaltcast","url":"https://forest.dev/p/roblox/alternativelua/enaltcast","files":"https://api.forest.dev/ai/package/roblox/alternativelua/enaltcast/files","readme":"# EnaltCast\n\nEnaltCast is a projectile module made for all kinds of purposes. It's the most performant library out there greatly beating FastCast and SwiftCast. With also many useful functions and capabilities packed within.\n\n## Features\n* **Insanely fast**: up to ~2× SwiftCast's FPS at 16,000 bullets alive at once (see [BENCHMARKS.md](BENCHMARKS.md))\n* **Parallelism**: optionally runs bullets across Actors, with least-loaded or round-robin balancing.\n* **Ricochets and penetration**\n* **Shape Casting**: give a bullet a radius and it uses spherecasts instead of thin rays\n* **Lag compensation**: server-side hitbox rewind\n* **Humanoid hits and near misses**: dedicated signals for hitting a character and for bullets passing close to a player\n* **Full cast control**: pause, resume, terminate, read position or change velocity mid-flight\n* **Efficient rendering**: bullet object pooling and distance-based render LOD\n* **Time scale**: slow motion or speed up all bullets on a caster\n\n## Usage\n\nInstall with [Wally](https://wally.run):\n\n```toml\n[dependencies]\nEnaltCast = \"nametakenbonk/enaltcast@0.0.8\"\n```\n\nCreate a caster, then fire bullets with a cast config:\n\n```lua\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal EnaltCast = require(ReplicatedStorage.Packages.EnaltCast)\n\nlocal caster = EnaltCast.new({ ParallelProcessing = true })\n\nlocal params = RaycastParams.new()\nparams.FilterType = Enum.RaycastFilterType.Exclude\nparams.FilterDescendantsInstances = { workspace.Shooter }\n\nlocal config = {\n\tSpeed = 300,\n\tExtraForce = Vector3.new(0, -workspace.Gravity, 0),\n\tRayParams = params,\n\tLifetime = 3,\n\tAttributes = {},\n\n\tOnImpact = caster:NewSignal(),\n\tOnHumanoidHit = caster:NewSignal(),\n\tOnRichochet = caster:NewSignal(),\n\tOnPenetration = caster:NewSignal(),\n}\n\nconfig.OnImpact:Connect(function(result: RaycastResult)\n\tprint(\"hit\", result.Instance, result.Position)\nend)\n\nconfig.OnHumanoidHit:Connect(function(result, data, humanoid: Humanoid)\n\thumanoid:TakeDamage(10)\nend)\n\n-- Fire from an origin in a unit direction. Optionally pass a BasePart (or a pooler) as the bullet visual.\nlocal handle = caster:Cast(config, origin, direction.Unit)\n```\n\n## Benchmarks\n\nSee [BENCHMARKS.md](BENCHMARKS.md) for performance comparisons against SwiftCast\n\n## Contribution\n\nOpen to contribution, if you feel like you want a feature or expeirence a bug open an issue. I will respond ASAP. If you also feel like wanting to write your own code fork the repo and open a PR. ","readmeTruncated":false}