NEW VERSION HERE!!! : Raycast Projectile Module V2! (kinda)
Hello! While trying to use other modules, I noticed that the projectile would sometimes bug out and get shaky, or cause lots of unnessesary stress to the server, so I decided to make this! It uses RaycastHitboxv4 for hit detection and heartbeat for movement so its as accurate as possible!
Ive made it as customizable as possible, allowing users to change the shotPart, visualizer, destroy distance, shotspeed, starting point, and end point!
How To Use
Create a new server script, and insert the code –
local RCPMod = require(script.Parent["Raycast Projectile Module"])
game.ReplicatedStorage.projectile.OnServerEvent:Connect(function(plr, mouseP)
local infoTbl = {
part = workspace.SHOTPART:Clone(),
sizeGap = 1,
destroyDistance = 100,
shotSpeed = 25,
startingPoint = plr.Character.HumanoidRootPart.CFrame,
shotDirection = mouseP,
visualizer = true,
plr = plr
};
infoTbl.part.CanCollide = false
RCPMod.Fire(infoTbl)
end)
How It Works
This uses OOP to seamlessly move, scan, and control all parts and values.
It moves the parts with Heartbeat, that way you can have as many projectiles firing at once as you need, and all the projectiles move extremely well.
The RaycastHitbox module allows for extremely accurate detections alongside debugging visualizers that allow you to see why the hitbox size, and why the projectile may not be working.
Instead of automatically doing damage and effects, it returns the character that it hits (then automatically disables its self and removes all remaining values), that way, you can add your own custom damage and hit effects that fit your game!
Please Note this is my first time using OOP, so please give me feedback so I can make the module run better, and with less bugs
idk how to use github, so get the module here -
RaycastProjectileModule_Update2.rbxm (18.1 KB)
Update2 Video :
Uploading: 2022-08-01 20-46-18.mp4…