Here is my script:
Local Script:
local rp = game:GetService("ReplicatedStorage") local event = rp:WaitForChild("RemoteEvent") local player = game:GetService("Players").LocalPlayer local Mouse = player:GetMouse() local debounce = false Mouse.Move:Connect(function() if debounce == false then debounce = true local MousePosition = Mouse.Hit event:FireServer(MousePosition) end end)
Server Script:
local rp = game:GetService("ReplicatedStorage") local event = rp:WaitForChild("RemoteEvent") event.OnServerEvent:Connect(function(player,mp) local projectile = player.Character:FindFirstChild("projectile") -- how do i make the projectile go the direction where my mouse was and move that direction? -- also, i placed projectile in body in earlier script. end)
EXTRA: also, another question I have is how can I make a projectile go outwards of my humanoid root part, or body part? (outward direction of body, and based on its rotation, not just always going left or something, it changes direction based on body rotation, forward of it).