What I am trying to achieve is making it so a projectile gets thrown in every direction in a 3d circle pattern. When I try to angle it up in a circle pattern the projectiles don’t go in the desired direction.
What I have so far…
Gyazo -
https://gyazo.com/603faaf3b9bf936b4fb215312fb43a0c
Server Script -
local Lighting = game:GetService("Lighting")
local Debounce = false
local Angles = {
{0, 0, 0},
{0, 45, 0},
{0, 90, 0},
{0, 135, 0},
{0, 180, 0},
{0, 225, 0},
{0, 270, 0},
{0, 315, 0}
}
Lighting.Fire.OnServerEvent:Connect(function(plr, root)
if Debounce == true then return end
Debounce = true
for i,v in pairs(Angles) do
local FireObjClone = Lighting.Objs.Flame:Clone()
FireObjClone.Parent = workspace
FireObjClone.CFrame = root.CFrame
FireObjClone:SetNetworkOwner(nil)
FireObjClone.BodyVelocity.Velocity = CFrame.Angles(0,math.rad(v[2]), 0).LookVector * 25
game.Debris:AddItem(FireObjClone, 5)
end
wait(3)
Debounce = false
end)
Local Script -
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard and script.Parent then
if script.Parent:FindFirstChild("HumanoidRootPart") then
local keyPressed = input.KeyCode
if keyPressed == Enum.KeyCode.Q then
game.Lighting.Fire:FireServer(script.Parent.HumanoidRootPart)
end
end
end
end)
Hi!, can you give me some more details on what exactly you are trying to achieve? I would be happy to help.
Yes. So basically what I’m trying to get at is I have projectiles going all around the waist.
Like this.
But what i’m trying to do is angle the projectiles to shoot out like is this. So it will also be shooting upwards. Which will create a 3d pattern when the projectiles shoot out.
Have you tried changing angles in your angles table? you only have y axis angles changing…
I have. When I change the z axis nothing changes. And when i change the x axis it doesn’t go correctly toward the angle I have specified.
did you change this ^^ to this vv when you did the new x/z angles?
CFrame.Angles(math.rad(v[1]),math.rad(v[2]), math.rad(v[3]))
I have. It doesn’t change the angles. When I put a 45 degree on the z-axis. Nothing happens.
local Lighting = game:GetService("Lighting")
local Debounce = false
local Angles = {
{0, 0, 0},
{0, 45, 0},
{0, 90, 0},
{0, 135, 0},
{0, 180, 0},
{0, 225, 0},
{0, 270, 0},
{0, 315, 0},
{0, 315, -45}
}
Lighting.Fire.OnServerEvent:Connect(function(plr, root)
if Debounce == true then return end
Debounce = true
for i,v in pairs(Angles) do
local FireObjClone = Lighting.Objs.Flame:Clone()
FireObjClone.Parent = workspace
FireObjClone.CFrame = root.CFrame
FireObjClone:SetNetworkOwner(nil)
FireObjClone.BodyVelocity.Velocity = CFrame.Angles(math.rad(v[1]),math.rad(v[2]), math.rad(v[3])).LookVector * 25
game.Debris:AddItem(FireObjClone, 5)
end
wait(3)
Debounce = false
end)
https://gyazo.com/3fe3643378b1cfb2f1ec1a772cd0582a
part.CFrame * CFrame.Angles(math.rad(v[1]),math.rad(v[2]), math.rad(v[3])).LookVector * 25
Try this? Maybe this will work or break some sort of way lol
(btw just keep it like this CFrame.Angles(math.rad(v[1]),math.rad(v[2]), math.rad(v[3])), nothing changes when you set them at 0, just in case you need to change angles later)
I mean it changed something but not the outcome I wanted lol.
https://gyazo.com/afb07177eafe44b5ccebeb1d2d4ec68b
you could just set them at the character primary part, rotate them, then just send to the parts look vector