Hello, recently I’ve wanted to make a basic projectile, I want the projectile to behave almost exactly like the official ROBLOX rocket launcher. And I’ve had the question of “What’s the best way to do it?”. I have seen a couple methods I’ve seen but I want community feedback.
PLEASE NOTE, I am not just begging for code, I actually want to understand but, I don’t know where to start. Please provide a slightly in-depth explanation as I’m really bad at understanding things.
I’ll show an example of a setup Here:
Basically, I want a projectile to come out of the attachment.
Here is the Client Script:
local Mouse = game.Players.LocalPlayer:GetMouse() local RE = script.Parent:WaitForChild("RemoteEvent") Mouse.Button1Down:Connect(function() local MousePos = Mouse.Hit RE:FireServer(MousePos) end)
BTW, I know Mouse() is deprecated but it’s easy to use, understand, and it’s cleaner. But if User Input Service is more performant or has some functionality needed, please let me know.
Here is the incomplete Server Script:
local RE = script.Parent:WaitForChild("RemoteEvent") local Hole = script.Parent.Parent.Handle.Attachment --Where the projectile should come out of RE.OnServerEvent:Connect(function(MousePos) local Projectile = Instance.new("Part") Projectile.CanCollide = false --STUFF GOES HERE end)
Thanks for reading!